Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensor flow does not install on windows 10 #20266

Closed
jonmelvin opened this issue Jun 25, 2018 · 6 comments
Closed

tensor flow does not install on windows 10 #20266

jonmelvin opened this issue Jun 25, 2018 · 6 comments
Assignees
Labels
type:build/install Build and install issues

Comments

@jonmelvin
Copy link

jonmelvin commented Jun 25, 2018

Windows 10, TensorFlow 1.8.1, NVIDIA 1060
Was working. Had to resinstall OS. Now I always get error below with
CUDA 8.0, CUDA 9.0, CUDA 9.2, Visual Studio 2015, Visual Studio 2017 (have tried everything I can think of). Any pointers for how to diagnose/solve?

(tensorflow) v:\deeplearning>python -W ignore test.py
Traceback (most recent call last):
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in
pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 1, in
import tensorflow as tf
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in
pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\jdm\Anaconda3\envs\tensorflow\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

@friketrike
Copy link

friketrike commented Jun 25, 2018

A bit of a shot in the dark since I don't see the same code from your stack-trace in the current state of the repo but since you ask for pointers, here goes:
You could use gflags to monitor dll loading when you run python -W ignore test.py.

Brace yourself for somewhat verbose output (remember to unset this after you've solved your issue) but you should see which dlls are being loaded and from where. You'll probably see one trying to load from each directory in your path and failing right before the stack-trace.

Additionally, once you've found a couple of suspect dlls, you can use dependency walker show information regarding the dlls that they will try to load. Dependency walke has a 32b and 64b version, they don't see all dlls equally, so you might need to use both.
Hope this helps and good luck

@tensorflowbutler
Copy link
Member

Nagging Assignee @tatianashp: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@jonmelvin
Copy link
Author

Thank you.

@jonmelvin
Copy link
Author

Finally tried this out.
In windows, cd ... (the folder where the python program was).
Typed gflags. Entered on image tab Python.exe and checked "show loader snaps".
Clicked "Launch".
Python launched.
Typed "import test_mnist" to run test_minst.py.
Same failure starting tensorflow ("A dynamic link library (DLL) initialization routine failed").
No additional output - nothing to help trying to find out what DLL failed.
I apologize for lack of knowledge here: I probably am missing a basic primer on getting output out of gflags. Jon

@jonmelvin jonmelvin reopened this Jul 13, 2018
@tatianashp tatianashp added the type:build/install Build and install issues label Jul 13, 2018
@tatianashp
Copy link
Member

If you are running on an older processor that has no support for AVX instructions it might be the same issue as discussed #19584.

@jonmelvin
Copy link
Author

Thanks.
Well, I went into Anaconda3 navigator and deleted the entire environment, created the environment again, and installed tensorflow-gpu, keras-gpu, etc etc only in Anaconda navigator (no "pip install …") and now it all works. Finally. Sorry to raise this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

4 participants