Issue 1:
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.

Issue 2:
As announced in release notes, TensorFlow release binaries version 1.6 and higher are prebuilt with AVX instruction sets. This means on any CPU that do not have these instruction sets either CPU or GPU version of TF will fail to load with any of the following errors:

ImportError: DLL load failed:

A crash with return code 132

Our recommendation is to build TF from sources on these systems.

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): ubuntu/windows/macos

TensorFlow installed from (source or binary): binary

TensorFlow version (use command below): 1.6 and up

Python version: 2.7, 3.3, 3.4, 3.5, 3.6 and any newer

Bazel version (if compiling from source): n/a

GCC/Compiler version (if compiling from source): n/a

CUDA/cuDNN version: any

GPU model and memory: any

Exact command to reproduce: python -c "import tensorflow as tf"