由于版本导致的错误
ImportError: cannot import name ‘PY3‘ :选择合适的版本重新安装torchvision
torch和torchvision版本匹配检查:https://github.com/pytorch/vision#installation
PyTorch AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘:大概率pytorch安装成了CPU版
安装GPU版本的pytorch(解决pytorch安装时默认安装CPU版本的问题)保姆级教程_3EoIPrime的博客-CSDN博客
conda activate xxx
python
import torch
torch.cuda.is_available()
conda list
conda uninstall cpuonly