导入tensorflow时出错,并且导入_pywrap_tensorflow_internal时DLL加载失败

时间:2020-08-16 01:43:04

标签: python tensorflow

我安装了tensorflow 2.3并成功安装了它,但是当我在程序中导入它时出现此错误,我尝试卸载重新安装它,同样的问题仍然存在 即使当我尝试升级tensorflow的版本时,同样的错误仍然存​​在。 ImportError跟踪(最近一次通话) 〜\ AppData \ Roaming \ Python \ Python38 \ site-packages \ tensorflow \ python \ pywrap_tensorflow.py在 63试试: `---> 64从tensorflow.python._pywrap_tensorflow_internal导入* 65#这种尝试捕获的逻辑是因为没有py_extension的等效符号。

ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Le module spécifié est introuvable.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\keras\__init__.py in <module>
  2 try:
  ----> 3     from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
  4 except ImportError:

  ~\AppData\Roaming\Python\Python38\site-packages\tensorflow\__init__.py in <module>
 40 
  ---> 41 from tensorflow.python.tools import module_util as _module_util
 42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader

 ~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\__init__.py in <module>
 39 
 ---> 40 from tensorflow.python.eager import context
 41 

 \AppData\Roaming\Python\Python38\site-packages\tensorflow\python\eager\context.py in <module>
 34 from tensorflow.core.protobuf import rewriter_config_pb2
 ---> 35 from tensorflow.python import pywrap_tfe
 36 from tensorflow.python import tf2

 ~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tfe.py in <module>
 27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
 ---> 28 from tensorflow.python import pywrap_tensorflow
 29 from tensorflow.python._pywrap_tfe import *

 ~\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
 82 above this error message when asking for help.""" % traceback.format_exc()
 ---> 83   raise ImportError(msg)
 84 

 ImportError: Traceback (most recent call last):
 File "C:\Users\lilya\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 while importing _pywrap_tensorflow_internal: Le module spécifié est introuvable.


 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.

 During handling of the above exception, another exception occurred:

 ImportError                               Traceback (most recent call last)
 <ipython-input-8-db7862463a42> in <module>
   ----> 1 from keras.preprocessing.text import Tokenizer
  2 from keras.preprocessing.sequence import pad_sequences
  3 from keras.models import Sequential
  4 from keras.layers import Dense, Embedding, LSTM, Dropout
  5 from keras.utils.np_utils import to_categorical

   C:\ProgramData\Anaconda3\lib\site-packages\keras\__init__.py in <module>
  3     from tensorflow.keras.layers.experimental.preprocessing import RandomRotation
  4 except ImportError:
   ----> 5     raise ImportError(
  6         'Keras requires TensorFlow 2.2 or higher. '
  7         'Install TensorFlow via `pip install tensorflow`')

   ImportError: Keras requires TensorFlow 2.2 or higher. Install TensorFlow via `pip install 
  tensorflow`

即使我尝试升级tensorflow的版本,同样的错误仍然存​​在。

0 个答案:

没有答案