異常處理2

西北逍遥發表於2024-07-02

from typing import Any, Callable, List, Optional, OrderedDict, Sequence, Tuple
ImportError: cannot import name 'OrderedDict' from 'typing' (E:\Anaconda3\install\envs\wind1\lib\typing.py)

開啟envs\wind1\Lib\site-packages\torchvision\models\maxvit.py

#from typing import Any, Callable, List, Optional, OrderedDict, Sequence, Tuple
from typing import Any, Callable, List, Optional, Sequence, Tuple
from collections import OrderedDict

########################