由于不知道什么原因,在Anaconda Prompt的Pytorch环境中能import torchvision 但在pycharm中无法import torchvision,torch和torchvision的版本是匹配的,于是卸载重装torch和torchvision,想装一个老版本1.10.0,经过一下午+一晚上的尝试,得出以下代码
pip3 --default-timeout=100 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html