Hi !!! Basically, I want to use a pre trained model for classifying an image on the GPU. Could someone please help. I did the following : (my model is alexnet and the image variable is img_var )
alexnet.cuda()
alexnet(img_var)
and it shows the following error :
File “try.py”, line 168, in
alexnet(img_var)
RuntimeError: expected CPU tensor (got CUDA tensor)
Please help I want to infer the image on the gpu