python - TensorFlow 错误:ImportError: DLL load failed with error code 3221225501 while importing _pywrap_ tensorflow_internal in Python3.8
问题描述
在导入 TensorFlow 时如何解决此错误:
- 蟒蛇 3.8.4。
- Windows 7 旗舰版 64 位。
- 2GB 内存。
- 英特尔(R) 赛扬(R) CPU N2840 @ 2.16GHz。
- 英特尔(R) 高清显卡。
>>> import tensorflow as tf
Traceback (most recent call last):
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\te
nsorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed with error code 3221225501 while importing _pywrap_
tensorflow_internal
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "G:\Users\Abdo-Prgraming\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed with error code 3221225501 while importing _pywrap_tensorflow_internal
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
解决方案
我有一个类似的问题,我的解决方案是通过 Anaconda 虚拟环境安装 tensorflow。
从他们的官方网站安装 Anaconda并创建虚拟环境并打开 Anaconda Prompt 然后...
conda create -n name_of_the_env
conda activate name_of_the_env
conda install tensorflow
推荐阅读
- chatbot - 为什么没有检测到我的通配符 + think + 条件?
- reactjs - 将 Formik 与 React.FC 一起使用
- c++ - 对 ofstream 的访问冲突
- java - OpenSubtitles API 响应
- bash - 如果满足条件,如何更新bash脚本中的一行
- reactjs - 我怎样才能做一个
每个参数的路径触发器“componentDidMount()”? - python - 我正在制作一个绘制线条的不和谐机器人,每次我多次使用 plot 命令时,它都会在上一个图表上绘制
- java - 查看作为 rt.jar 一部分的 sun.misc 的源代码
- sql - SQL - MS Access Form 设计 - 添加 ISA 关系数据
- javascript - 无法从父范围访问节点 js 要求