tensorflow / models

Models and examples built with TensorFlow
Other
76.98k stars 45.79k forks source link

tensorflow issue: ImportError: DLL load failed: %1 is not a valid Win32 application. ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' #2323

Closed RanjitData2Decision closed 7 years ago

RanjitData2Decision commented 7 years ago

System information

logs

D:\Study\ML\RNN\models\tutorials\rnn\ptb>python ptb_word_lm.py --data_path=D:/Study/ML/RNN/simple-examples/data/ --model=small Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Program Files\Python36\lib\importlib__init__.py", line 126, in impor t_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 648, in _load_unlocked File "", line 560, in module_from_spec File "", line 922, in create_module File "", line 205, in _call_with_frames_removed ImportError: DLL load failed: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 21, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Program Files\Python36\lib\importlib__init__.py", line 126, in impor t_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "ptb_word_lm.py", line 65, in import tensorflow as tf File "C:\Program Files\Python36\lib\site-packages\tensorflow__init.py", lin e 24, in from tensorflow.python import * File "C:\Program Files\Python36\lib\site-packages\tensorflow\python__init__.p y", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow.py", line 52, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Program Files\Python36\lib\importlib\init__.py", line 126, in impor t_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 648, in _load_unlocked File "", line 560, in module_from_spec File "", line 922, in create_module File "", line 205, in _call_with_frames_removed ImportError: DLL load failed: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 21, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_ten sorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Program Files\Python36\lib\importlib__init__.py", line 126, in impor t_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

RanjitData2Decision commented 7 years ago

Issue resolved by this. Since mine is a non GPU system I just installed MSVCP140.DLL and included ".DLL" in PATHEXT variable as stated in the SO link. This solved my issue.