RuntimeError: expected scalar type Long but found Int in loss = criterion(outputs, y_train)
I built this acoustic model with features dim = [1124823,13] and labels dim = [1124823,1] and I split both to train, test, and dev. The problem that when I try to run my model I get this error

RuntimeError: expected scalar type Long but found Int in
  loss = criterion(outputs, y_train)

import torch
import torch.nn as nn
from fela import feat, labels
from Dataloader import train_loader, test_loader, X_train, X_test, X_val, y_train, y_test, y_val

################################################################################################
input_size = 13
hidden1_size = 13
hidden2_size = 128
hidden3_size = 64
output_size = 50

################################################################################################

class DNN(nn.Module):
   def __init__(self, input_size, hidden2_size, hidden3_size, output_size):
       super(DNN, self).__init__()
       self.fc1 = nn.Linear(input_size, hidden1_size)
       self.relu1 = nn.ReLU()
       self.fc2 = nn.Linear(hidden1_size, hidden2_size)
       self.relu2 = nn.ReLU()
       self.fc3 = nn.Linear(hidden2_size, hidden3_size)
       self.relu3 = nn.ReLU()
       self.fc4 = nn.Linear(hidden3_size, output_size)
       self.relu4 = nn.ReLU()

   def forward(self, x):
       out = self.fc1(x)
       out = self.relu1(out)
       out = self.fc2(out)
       out = self.relu2(out)
       out = self.fc3(out)
       out = self.relu3(out)
       out = self.fc4(out)
       out = self.relu4(out)
       return out
################################################################################################
# Instantiate the model
batch_size = 50
n_iterations = 50
no_epochs = 80
model = DNN(input_size, hidden2_size, hidden3_size, output_size)

################################################################################################
# Define the loss criterion and optimizer
criterion = nn.CrossEntropyLoss()
learning_rate = 0.01
optimizer = torch.optim.SGD(model.parameters(), lr=learning_rate)
print(model)
########################################################################################################################
# train the network
iter = 0
for epoch in range(no_epochs):
   for i, (X_train, y_train) in enumerate(train_loader):
       optimizer.zero_grad()
       outputs = model(X_train)
       loss = criterion(outputs, torch.max(labels, 1)[1])
       loss.backward()
       optimizer.step()
       iter += 1
       if iter % 500 == 0:
           correct = 0
           total = 0
           for X_test, y_test in test_loader:
               outputs = model(X_test)
               _, predicted = torch.max(outputs.data, 1)
               total += labels.size(0)
               correct += (predicted == labels).sum()
           accuracy = 100 * correct / total
           print(iter, loss.data[0], accuracy)


I think no_epochs=0 with this initialization. Possibly (len(train_loader) / batch_size) > n_iterations. Then int(no_eps) = 0. Try to change no_epochs to 100 manually, for example.

no_eps = n_iterations / (len(train_loader) / batch_size)
no_epochs = int(no_eps)
for epoch in range(no_epochs):

