no module named ‘torchvsion‘

pip install torchvision后
又报 no model named ‘torch.utils.checkpoint’
这时候pip不好使了
排查了下,感觉是torch和torchvision版本不匹配
更重要的是我忘记我的torch版本是啥了
于是我在jupyter notebook里面

import torch
print(torch.__verdion__)

显示我的torch是1.3.1版本’
此时我彻底蒙圈了
啥意思???
我的cmd命令行pip时报的错误是

No matching distribution found for torch==1.4.0 (from torchvision)

wtf??!!

怎么一会1.3.1一会1.4.0了
于是我在cmd内输入python。进入python 交互界面
然后import torch
居然报错了,可是jupyter notebook里不报错啊

冷静下来后
我把pytorch和torchvision全部pip uninstall
然后老老实实去官网https://pytorch.org/get-started/locally/
复制命令行

pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

下载
好在公司的网给力很快下载好了

你可能感兴趣的:(pytorch,深度学习)