0

The code I wrote was this:

from tensorflow.keras.models import Sequential

and this is the error which was given... it would be great if someone could tell a way out


ImportError                               Traceback (most recent call last)
~\Python\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: The specified module could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-18-f05745da3b73> in <module>
----> 1 from tensorflow.keras.models import Sequential

~\Python\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 

~\Python\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

~\Python\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\saksh\Python\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: The specified module could not be found.


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.
Lescurel
  • 10,749
  • 16
  • 39
sakshi
  • 1
  • 1
  • Does this answer your question? [can't import tensorflow in python, windows 10 64 bit](https://stackoverflow.com/questions/60319768/cant-import-tensorflow-in-python-windows-10-64-bit) – Lescurel May 03 '21 at 09:43
  • yes this entirely resolved my problem – sakshi May 04 '21 at 14:29

1 Answers1

0

Error message says that some DLL files failed load, this because Tensorflow package is not installed properly. Reason might be you not installed the MSVC 2019 redistributable or Your CPU does not support AVX2 instructions.

Install the software requirements and make sure your system meet hardware requirements mentioned on the Tensorflow install document.