I think your situation is similar to this, you should redesign your program according to the provided tutorial.

  
    
    
    TypeError: 'DataLoader' object is not callable 
  
  
    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.5…