train_loader = DataLoader(dataset=dataset, batch_size=40, shuffle=False)
" This is my train loader variable."
for epoch in range(num_epochs):
for i in enumerate(train_loader):
t = train_loader(-1,1).to(device)
outputs = model(t)
loss = criterion(outputs)
optimizer.zero_grad()
loss.backward()
optimizer.step()
    if (i + 1) % 100 == 0:
        print('Epoch [{}/{}], Step [{}/{}], Loss: {:.4f}'.format(epoch + 1, num_epochs, i + 1, total_step, loss.item()))


Screenshot 2020-04-01 at 12.57.59 PM1214×456 39.2 KB

I’m getting this error whatever I change. Can anyone help me with this?
Thanks in advance