报错:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/yjiang/anaconda3/lib/python3.7/site-packages/torch/__init__.py", line 79, in <module>
from torch._C import *
ImportError: dlopen(/Users/yjiang/anaconda3/lib/python3.7/site-packages/torch/_C.cpython-37m-darwin.so, 9): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Users/yjiang/anaconda3/lib/python3.7/site-packages/torch/lib/libshm.dylib
Reason: image not found
解决方法:
brew install libomp
在pytorch官方的issue中提供了相应的解决方法