
查看:torch
bash
import torch
# 输出带CPU,表示torch是CPU版本的
print(f'torch的版本是:{torch.__version__}')
#
print(f'torch是否能使用cuda:{torch.cuda.is_available()}')

修改一下代码,将cuda改成cpu

最后运行正常:
