【问题标题】:python import torch errpython导入火炬错误
【发布时间】:2023-04-01 11:35:02
【问题描述】:

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
>>>

【问题讨论】:

  • @M.Soyturk pip install -U numpy 我试过了,没用
  • 尝试按照这个问题降级您的 Numpy。您的错误消息不完全匹配,但非法值消息看起来像这个问题的很多重复项。 stackoverflow.com/questions/64654805/…

标签: python python-3.x


【解决方案1】:

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

pip install --upgrade pip
pip install -U numpy

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

【讨论】:

    猜你喜欢
    • 2022-11-17
    • 1970-01-01
    • 2022-01-27
    • 2019-01-12
    • 2019-02-14
    • 1970-01-01
    • 2020-07-06
    • 1970-01-01
    • 2020-12-12
    相关资源
    最近更新 更多