from typing import OrderedDict ImportError: cannot import name ‘OrderedDict‘ from ‘typing‘
配置文件中往往用到OrderedDict保存一些接口信息 有时遇到
ImportError: cannot import name 'OrderedDict' from 'typing'
这是python版本的问题 python3.5以下OrderedDict要从typing导入, 而高于此的python版本是在collections包中导入的OrderedDict
到 #your python environment path/lib/python3.7/site-packages/torchvision/models/maxvit.py
文件中 将
from typing import OrderedDict
改为
from collections import OrderedDict
(因为改了python原始包中的源码 故在这里记录一下)