python - 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
>>>
解决方案
我认为这个问题可以通过升级pip和numpy来解决:
pip install --upgrade pip
pip install -U numpy
(如果你有多个版本的 python 也许你必须这样做python3.6 -m pip ...
)
推荐阅读
- file - 为什么我不能写入文件?
- ruby - 在 Ruby 中加载带有变量的 YAML 文件
- reactjs - 将自定义环境变量传递到 dockerized react-admin 应用程序
- apache-kafka - 为什么 kafka 流状态目录位于 /tmp/kafka-streams 中?
- javascript - 在空闲/不活动时刷新网页
- saml-2.0 - 我的 mvc 应用程序在一段时间 [30m] 不活动后注销并且当我单击站点的任何链接时
- jenkins - Jenkins 声明性管道不读取阶段或步骤
- reactjs - 如何在 next.js(带有 react-native-web 支持)项目中重用 react-native 代码?
- maven - 如何使用带有管道的 Docker 缓存本地 Maven 存储库?
- java - 过度写入数组与删除并重新初始化它?爪哇