Oh, ok, i didnt understand that they are the same thing, thank you. I already made, your suggestions, then i get the following errors:
File “C:/Users/user/.spyder-py3/my_cnn.py”, line 109, in 
loss = criterion(label,output)
File “C:\Users\user\Anaconda3\lib\site-packages\torch\nn\modules\loss.py”, line 431, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File “C:\Users\user\Anaconda3\lib\site-packages\torch\nn\functional.py”, line 2199, in mse_loss
ret = (input - target) ** 2
RuntimeError: The size of tensor a (251) must match the size of tensor b (10) at non-singleton dimension 1
This is the alterations:
criterion = nn.MSELoss()
best= 12311242
learning_rate = 1e-3
optimizer = torch.optim.Adam(
model.parameters(), lr=learning_rate, weight_decay=0)
iter = 0
start = time.time()
for epoch in range(num_epochs):
for data in train_loader:
img, label= data
label = Variable(label).cuda()
img = Variable(img).cuda()
nova=to_img(img)
    st = time.time()

    optimizer.zero_grad()

    output = model(img)

    loss = criterion(label,output)

    loss.backward()

    optimizer.step()

    iter += 1

print('epoch [{}/{}], loss:{:.4f}'
              .format(epoch + 1, num_epochs, loss.item()))

if epoch % 1 == 0:
    pic = to_img(output.cpu().data)
    if loss.item()<best:
        best=loss.item()