ImportError: cannot import name ‘InterpolationMode‘ from ‘torchvision.transforms‘

这个原因是torchvision的版本太久了,这个InterpolationMode是新版本中的函数,

报错前的版本:

torchvision=0.2.2

torch=1.8.2

解决办法:

pip install torchvision==0.9.1
这个完全没有任何副作用,升级更高版本的,可能会卸载你之前的torch,比较麻烦。

猜你喜欢

转载自blog.csdn.net/weixin_44503976/article/details/128093043
今日推荐