In the pytorch official website there is a program that is to train the CIFAR10 train set. Now I want to train it on the GPU ,but the is always an error called ‘Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same’, and I understand what the type of the error is . But because I am confused where should add the ‘.cuda ()’ and where not when , I can not fix the bug . So, is there any Mr. Big that could help me to solve this problem? Thanks a lot!
Based on the error message it seems like your model is still on the CPU.
Try to call
model.to('cuda') to push it onto your GPU and run it again.