Thanks for the answer, I’ll try when I get home.
To the error: I’m moving input and target to the GPU with .to(device), then pass the input through my network (which has also been moved to GPU) with prediction = model(input).
When I then call loss = criterion(prediction, target), the error is thrown. So it means the prediction I get from my network is still on CPU even though the network should be on GPU. The target is on GPU as it should be.