可能问题1:cuda 与 torch 版本不对应
可能问题2:安装的torch是cpu版本,或者无cuda版本
可能问题3:torch的关联包未安装
解决方案:使用conda重新安装
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
10.1是cuda版本号
conda 不仅会安装torch,还会安装关联包
可能问题1:cuda 与 torch 版本不对应
可能问题2:安装的torch是cpu版本,或者无cuda版本
可能问题3:torch的关联包未安装
解决方案:使用conda重新安装
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
10.1是cuda版本号
conda 不仅会安装torch,还会安装关联包