首页 > 解决方案 > python导入火炬错误

问题描述

python import torch err,通过pip安装的torch版本是1.7.0+cu110,我在这个问题上浪费了一天时间,有人知道怎么解决吗,谢谢

C:\Users\xujimu\Desktop\Bringing>python
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
 ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Program Files\Python36\lib\site-packages\torch\__init__.py", line 190, in <module>
    from torch._C import *
ImportError: numpy.core.multiarray failed to import
>>>

标签: pythonpython-3.x

解决方案


我认为这个问题可以通过升级pip和numpy来解决:

pip install --upgrade pip
pip install -U numpy

(如果你有多个版本的 python 也许你必须这样做python3.6 -m pip ...


推荐阅读