Hi
I could run the code on one machine but then it doesn’t work on another machine with the same pytorch version 0.4.1
But the CPUs all goes into sleep mode after on iteration of loss.backward(), no errors and the program is stuck then.
code is like this:

for i,batchdata in enumerate(train_loader):
optimizer.zero_grad()
x,y=batchdata
y_pred=model(x)
print(x)
print(len(x))
print(y_pred)
loss_train=criterion(y_pred,y)
print(loss_train)
loss_train.backward(retain_graph=True)
print('done batch ').
optimizer.step()
print(“Finished Step”)

Any idea about what might happen here? many thanks in advance.