导入torch时报错:
>>> import torch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\app\Anaconda3\envs\ABSA-PyTorch-master\lib\site-packages\torch\__init__.py", line 20, in <module>
from torch._C import *
ValueError: module functions cannot set METH_CLASS or METH_STATIC
原因是Numpy版本不匹配,将Numpy升级即可。使用conda执行命令:
conda upgrade numpy