Skip to content
Advertisement

Problem with data cast on the GPU in PyTorch

Im trying to do an image classifier, but im having a problem with the data cast on the GPU.

JavaScript

Model already is in cuda, but i get error that says

JavaScript

Whats the problem with input.to(args['device'])?

Advertisement

Answer

UPDATE: According to the OP, an aditional data.to(device) before the train loop caused this issue.

you are probably getting a string like 0 or cuda from args[‘device’]; you should do this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement