ImportError: cannot import name 'Optional'
程序员文章站
2022-06-15 13:45:16
...
报错:from torch.jit.annotations import Optional
ImportError: cannot import name ‘Optional’
查看自己的pytorch版本和torchvision版本是否对照~
>>> import torch
>>> import torchvision
>>>
>>> torch.__version__
'1.1.0'
>>> torchvision.__version__
'0.3.0'
>>>
>>> exit()
安装pytorch1.0 要对应安装torchvision0.2.0
上一篇: Rafy 框架 - 流水号插件
下一篇: es报错:org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: no requests ad
推荐阅读
-
pycharm读取图片,提示ImportError: cannot import name imread解决方法
-
ImportError: cannot import name 'cross_validation' from 'sklearn'
-
cannot import name 'Flask' from 'flask'
-
ImportError: cannot import name 'Optional'
-
Python中使用Enum类时出现cannot import name ‘Enum‘ from partially initialized module ‘enum‘
-
cannot import name ‘Graph‘ from ‘pyecharts‘
-
解决pyecharts importerror问题:cannot import name ‘bar’ from pyecharts
-
ImportError: cannot import name ‘Bar‘ from ‘pyecharts‘ (D:\Anaconda3-2019.03\Anaconda3\lib\site-pack
-
2021-06-13cannot import name ‘Bar‘ from ‘pyecharts.charts‘ (C:\Users\SieburgShen\AppData\Roaming\Pyt
-
解决pyecharts导包报错 cannot import name 'Bar