RuntimeError: Expected object of backend CPU but got backend CUDA for argument #4 'mat1'

data=data.cuda()

 

How to run a program on the GPU

CUDA_VISIBLE_DEVICES=O,1 python3 main.py //程序只能使用GPU:1

 

Published 234 original articles · won praise 61 · views 120 000 +

Guess you like

Origin blog.csdn.net/weixin_42528089/article/details/104796265