Hi there,
The solution adressed above is absolutely correct. Some of the tensors are at gpu and some are at cpu.
As suggested by the above solutions as you can move the tensor to gpu by .cuda() call, similarly you can move the tensor/model on the cpu by .cpu() call. It will come handy.
Either you can use the solution above, but defining the device on which the neural networks and tensors is the right and more informative approch. Define the device by :-
Device = torch.device(‘cuda’ if torch.cuda.is_available() else ‘cpu’)
torch.cuda.is_available() checks if cuda(or gpu) is available to you or not
Now I can already see that you have cuda on your system, but still its an additive line to check which device you can have while working with pytorch.
Then the model can be moved on the said device as :
model = model.to(Device)
and the tensors(t) can be put on the device the same way :
t = t.to(Device)
Hope this helps, this is just for further info.
Thanks