![](/img/trans.png)
[英]Tensorflow installation on Windows: DLL load failed while importing _pywrap_tensorflow_internal
[英]Tensorflow 2.4 - DLL load failed while importing _pywrap_tensorflow_internal
I use TensorFlow 2.4 on Windows 10 with Python 3.8 (I have Python 3.9 and 3.6 installed too) within a virtual environment ml2u
where only TensorFlow 2.4 is installed so far by pip install tensorflow
. 我通過嘗試在筆記本中導入 TensorFlow 收到以下錯誤消息。 正如其他帖子中所推薦的那樣,我已經安裝了 Microsoft Visual C++ redistributable,這導致了 MS Visual 和VC_redist.x64.exe
的安裝。
import tensorflow as tf
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
c:\users\lenovo\appdata\local\programs\python\python38\scripts\ml2u\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
63 try:
---> 64 from tensorflow.python._pywrap_tensorflow_internal import *
65 # This try catch logic is because there is no bazel equivalent for py_extension.
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Eine DLL-Initialisierungsroutine ist fehlgeschlagen.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-1-64156d691fe5> in <module>
----> 1 import tensorflow as tf
c:\users\lenovo\appdata\local\programs\python\python38\scripts\ml2u\lib\site-packages\tensorflow\__init__.py in <module>
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43
c:\users\lenovo\appdata\local\programs\python\python38\scripts\ml2u\lib\site-packages\tensorflow\python\__init__.py in <module>
37 # go/tf-wildcard-import
38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
---> 39 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
40
41 from tensorflow.python.eager import context
c:\users\lenovo\appdata\local\programs\python\python38\scripts\ml2u\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
81 for some common reasons and solutions. Include the entire stack trace
82 above this error message when asking for help.""" % traceback.format_exc()
---> 83 raise ImportError(msg)
84
85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "c:\users\lenovo\appdata\local\programs\python\python38\scripts\ml2u\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Eine DLL-Initialisierungsroutine ist fehlgeschlagen.
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.
----
The shell produced followint output while running jupyter:
[W 20:51:12.010 NotebookApp] Notebook Untitled.ipynb is not trusted
[I 20:51:14.060 NotebookApp] Kernel started: 0d0455bd-ade8-4128-b273-0b24e8d9228f, name: ml2u
您可能會遇到此問題,因為您正在運行 32 位 python 或 32 位操作系統。 並檢查您的 CPU 是否支持 AVX 指令。
請查看系統要求並檢查您是否安裝了正確的依賴項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.