title: RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target' in call to _thnn_nll_loss_forward
body: <p>I am trying Bert on the Tweeter dataset. I am encountered with the following error message.</p>
  <pre><code># set initial loss to infinite
  best_valid_loss = float('inf')
  
  # empty lists to store training and validation loss of each epoch
  train_losses=[]
  valid_losses=[]
  
  #for each epoch
  for epoch in range(epochs):
   
      print('\n Epoch {:} / {:}'.format(epoch + 1, epochs))
  
  #train model
  train_loss, _ = train()
  
  #evaluate model
  valid_loss, _ = evaluate()
  
  #save the best model
  if valid_loss &lt; best_valid_loss:
      best_valid_loss = valid_loss
      torch.save(model.state_dict(), 'saved_weights.pt')
  
  # append training and validation loss
  train_losses.append(train_loss)
  valid_losses.append(valid_loss)
  
  print(f'\nTraining Loss: {train_loss:.3f}')
  print(f'Validation Loss: {valid_loss:.3f}')
  </code></pre>
  <p>It is a very long code. Searching for the issues led me to change .float() to long(). I already did that. Kindly suggest me the solution.
  Very Important: The same code work perfectly well on another dataset (with same number of columns and same type of data) but is not working on tweets data. (Only difference is the size. Previous was having 5500 entries while the tweet dataset has 10000 entries)</p>