我之前使用的torch0.4.1,numpy1.20.1,运行时报错PyTorch was compiled without NumPy support
后来经查找发现以下解决方法
1.将numpy
版本改为 1.15.0
pip install numpy==1.15.0
2.更新从 torch-0.4.1
到 torch-0.4.1.post2
pip install torch==0.4.1.post2
使用1后会报另一种错误(忘截图了),大概是这样:ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
之后我又把numpy
版本改为了1.20.1
,然后更新torch
从 torch-0.4.1
到 torch-0.4.1.post2
,就可以了,所以第一步没必要