【发布时间】:2023-02-16 01:51:07
【问题描述】:
我打开 Anaconda Navigator,点击环境,点击更新索引,从下拉列表中选择卸载,搜索 Tensorflow,选择 Keras 和选择 Tensorflow,点击应用,然后我继续直到过程成功完成,然后我退出了。之后,我打开 Jupyter Notebook 并输入代码“import tensorflow as tf” 但是,我遇到了以下错误:
ImportError Traceback (most recent call last)
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
61 try:
---> 62 from tensorflow.python._pywrap_tensorflow_internal import *
63 # This try catch logic is because there is no bazel equivalent for py_extension.
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_8976\3793406994.py in <module>
----> 1 import tensorflow as tf
~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
35 import typing as _typing
36
---> 37 from tensorflow.python.tools import module_util as _module_util
38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
39
~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
34 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
35
---> 36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
37 from tensorflow.python.eager import context
38
~\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
75 sys.setdlopenflags(_default_dlopen_flags)
76 except ImportError:
---> 77 raise ImportError(
78 f'{traceback.format_exc()}'
79 f'\n\nFailed to load the native TensorFlow runtime.\n'
ImportError: Traceback (most recent call last):
File "C:\Users\Amir\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.
【问题讨论】:
-
您是否选择了正确的环境?
-
你在你的环境中运行什么 python 版本?
-
你运行的是哪个版本的Windows?
标签: python tensorflow machine-learning jupyter-notebook