title: Print function does not print anything while working to build CNN Architecture
body: <p>I am learning image classification with CNN in Pytorch. While I started to build the CNN architecture I am getting 2 problem:</p>
  
  <ol>
  <li><p>When I run my code I get the warning <code>-warnings.warn("train_labels has been renamed targets")</code></p></li>
  <li><p>I tried to print loss and accuracy using <code>print</code> function but it does not print anything.</p></li>
  </ol>
  
  <p>Here is my code:</p>
  
  <pre><code> def forward(self, x):
       out = self.layer1(x)
       out = self.layer2(out)
       out = out.reshape(out.size(0), -1)
       out = self.drop_out(out)
       out = self.fc1(out)
       out = self.fc2(out)
       return out
       from torch import optim
       model = ConvNet()
       criterion = nn.CrossEntropyLoss()
       optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate)
       total_step = len(train_loader)
       loss_list = []
       acc_list = []
       for epoch in range(num_epochs):
          for i, (images, labels) in enumerate(train_loader):
  
            outputs = model(images)
            loss = criterion(outputs, labels)
            loss_list.append(loss.item())
            optimizer.zero_grad()
            loss.backward()
            optimizer.step()
  
            total = labels.size(0)
            _, predicted = torch.max(outputs.data, 1)
            correct = (predicted == labels).sum().item()
            acc_list.append(correct / total)
            if (i + 1) % 100 == 0:
             print("Epoch [{}\{}], Step [{}\{}], Loss: {:.4f}, Accuracy: {:.2f}%"
                      .format(epoch + 1, num_epochs, i + 1, total_step, loss.item(),
                              correct / total) * 100)
  
          # Test the model
            model.eval()
            with torch.no_grad():
              correct = 0
              total = 0
              for images, labels in test_loader:
                  outputs = model(images)
                  _, predicted = torch.max(outputs.data, 1)
                  total += labels.size(0)
                  correct += (predicted == labels).sum().item()
  
              print("Test Accuracy of the model on the 10000 test images: {} %".format((correct / total) * 100))
  </code></pre>