问题:
import torch as th后,报错如下
ImportError: cannot import name 'MappingProxyType' from partially initialized module 'types' (most likely due to a circular import) (/home/wsk/.conda/envs/pytorch/lib/python3.9/site-packages/torch/types.py)
解决:
github中提到
You're likely in the wrong directory, go to the repo root. Also you need to run python3 -m mypy.messages
(you were missing the s
).
运行该代码后,就正常了(不懂为什么,有点奇怪)