gpt4 book ai didi

tensorflow - 导入错误 : DLL load failed: A dynamic link library (DLL) initialization routine failed

转载 作者:行者123 更新时间:2023-12-04 12:08:24 24 4
gpt4 key购买 nike

我在 Conda 环境中使用 CUDA Toolkit v9.0 和 cuDNNv7.1 以及 Python 3.6 安装了支持 CPU 的 TensorFlow。
我按照 TensorFlow 网站中描述的说明进行操作,当我尝试时:

import tensorflow as tf
我收到此错误:
Traceback (most recent call last):
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import * # pylint: disable=redefined-builtin
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


Failed to load the native TensorFlow runtime.
我错过了什么?

最佳答案

我找到了解决方案,可能是您的 CPU 不支持 AVX,所以我从在 github 上找到的这个定制存储库安装了 tensorflow
链接在这里

https://github.com/fo40225/tensorflow-windows-wheel

我在该文件夹中为 py 37 选择了 1.12.0 选择 py36 文件夹和 cpu 文件夹并在 sse2 中下载文件

不支持下载sse2 whl的cpu

关于tensorflow - 导入错误 : DLL load failed: A dynamic link library (DLL) initialization routine failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49932993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com