環境:
win10
Anaconda 2020.07.20
虛擬環境tf2nlp + python3.7
問題:進入虛擬環境,安裝:pip install tensorflow==2.0,啟動python,匯入tensorflow時,出現了以下報錯。然后我根據報錯提示,去微軟官網下載VC_redist.x64.exe 進行安裝,然而報錯還是一樣。網上的相關文章都是說要降低tf的版本,然而降級并不是我的想法,我要用的是tensorflow2.x,因為tf1.x已經過時,不再擁有維護,所以我想知道有什么辦法能夠解決這個報錯嗎?
報錯如下:
ImportError: DLL load failed: 元件(DLL)初始化例程失敗。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow\__init__.py", line 98, in <module>
from tensorflow_core import *
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\__init__.py", line 42, in <module>
from . _api.v2 import audio
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\_api\v2\audio\__init__.py", line 10, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\ops\gen_audio_ops.py", line 9, in <module>
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Anaconda3\envs\tf2nlp\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda3\envs\tf2nlp\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Anaconda3\envs\tf2nlp\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda3\envs\tf2nlp\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 元件(DLL)初始化例程失敗。
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.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/210009.html
標籤:人工智能技術
上一篇:ui轉py檔案
