[go: nahoru, domu]

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

Tensorflow 1.8.0 cpu fails on import on Windows 10 used through SQL Server 2017 #20674

Closed
GKilianW opened this issue Jul 10, 2018 · 19 comments
Closed
Assignees
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues

Comments

@GKilianW
Copy link

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No. import tensorflow as tf
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 x64 on SQL Server 2017
  • TensorFlow installed from (source or binary): Binary - pip install N:\Packages\Python\tensorflow-1.8.0-cp35-cp35m-win_amd64.whl -f ./ --no-index
  • TensorFlow version (use command below): 1.8.0
  • Python version: 3.5
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A
  • Exact command to reproduce: import tensorflow as tf

running through sql the full code is:

EXECUTE sp_execute_external_script
@language=N'Python',
@script = N'
import tensorflow as tf
'

Describe the problem

All dependencies for tensorflow 1.8.0 are installed.
Installation through pip ends with "Successfully installed tensorflow-1.8.0"

Attempting to import tensorflow fails with:
Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
Failed to load the native TensorFlow runtime.

Full error report below.

I have checked that MSVCP140.DLL exists in System32 and in SysWOW64.
I don't know how to check for an AVX issue or to bypass it.

Source code / logs

Traceback (most recent call last):
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed

Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
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 "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 5, in
File "D:\MSSQL14.MSSQLSERVER\MSSQL\ExtensibilityData\MSSQLSERVER01\EA86FFCC-FD02-4E32-B3CB-E9AF5CE7CC5F\sqlindb.py", line 31, in transform
import tensorflow as tf
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):

Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

Msg 39019, Level 16, State 2, Line 7
An external script error occurred:
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.

@gunan
Copy link
Contributor
gunan commented Jul 13, 2018

Could you share your CPU model?
This can be a duplicate of #19584

@GKilianW
Copy link
Author

It is a windows server 2016 datacenter.
Processor: Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60Hz 2.60GHz
Installed Memory (RAM): 12.0 GB
System Type: 64-bit Operating System, x64-based processor

@gunan
Copy link
Contributor
gunan commented Jul 13, 2018

Hmm, it looks like CPU model has AVX, but still the failure we see is during dll loading.
Here are a few more questions:
1 - What happens if you use the standard python terminal, and run import tensorflow as tf? do you see the same error?
2 - If it is easy, what do you see when you try the same with tensorflow 1.5?

@GKilianW
Copy link
Author

1 - It looks like the same error as before. Posted below.

2 - The server doesn't have an internet connection. I am installing tensorflow and all of its dependencies through wheel files found on PyPI. When I went through finding all of the dependencies for 1.5, some were no longer available on PyPI.

@GKilianW
Copy link
Author
GKilianW commented Jul 13, 2018

Traceback (most recent call last):
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
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 "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
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 "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

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.

@GKilianW
Copy link
Author

For the record, I am fine trying 1.5, if someone can provide me with the .whl or .tar.gz files for the for everything.

@gunan
Copy link
Contributor
gunan commented Jul 14, 2018

Let me see, we may be lucky and it may just have the same dependencies.

@GKilianW
Copy link
Author

Any more word on this?

@gunan
Copy link
Contributor
gunan commented Jul 18, 2018

Sorry for the radio silence. I am travelling right now, thus unable to respond. I will check the dependencies of TF 1.5 and 1.8, and see if there is an easy way to try this out.
In the meantime, @meteorcloudy @mrry @guschmue in case they have another idea.

@GKilianW
Copy link
Author

Checking in on this again and hoping for a good solution.

@rohan100jain rohan100jain assigned mrry and gunan and unassigned rohan100jain Jul 27, 2018
@rohan100jain rohan100jain added stat:awaiting tensorflower Status - Awaiting response from tensorflower type:build/install Build and install issues labels Jul 27, 2018
@GKilianW
Copy link
Author
GKilianW commented Aug 7, 2018

Checking in on this again.

@gunan
Copy link
Contributor
gunan commented Aug 9, 2018

Sorry for the delay, I am trying to find and share a non-avx 1.8 pip package for you, but I have been quite busy lately.
I am sorry for the delay.

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Aug 9, 2018
@Overdrivr
Copy link

I have exactly the same issue, with also an Intel Xeon E5-2623 v4.
Impossible to import tensorflow-cpu.
See ticket: #22512

@gunan
Copy link
Contributor
gunan commented Sep 27, 2018

@GKilianW
Copy link
Author

I tried this code in command prompt:

pip install N:\Packages\Python\tensorflow-1.10.1-cp36-cp36m-win_amd64.whl -f ./ --no-index

and it returned this error:

tensorflow-1.10.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

@GKilianW
Copy link
Author

I need cp35 I think.

@gunan
Copy link
Contributor
gunan commented Sep 27, 2018

You may try requesting a wheel from here, given that I was not able to provide a wheel in time.

Another issue that came up is, (actually brought up by @Overdrivr ) It looks like when Microsoft Visual C++ 2015 Redistributable 64 bits. is missing we also error out the same way.
Could you try installing that from here?
https://www.microsoft.com/en-us/download/details.aspx?id=53840

@mrry mrry added the stat:awaiting response Status - Awaiting response from author label Dec 8, 2018
@mrry mrry removed their assignment Dec 8, 2018
@tensorflowbutler
Copy link
Member

We are closing this issue for now due to lack of activity. Please comment if this is still an issue for you. Thanks!

@Stentaur
Copy link
Stentaur commented Oct 5, 2020

also having this issue when installing tensorflow 2.3.1 on a machine with no internet connection; as far as I can tell, I have pip installed all the appropriate wheel files.

_pywrap_tensorflow_internal does exist (twice) in the correct place, but the file endings are .pyd and .lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

7 participants