0

System information

Have I written custom code: No

OS Platform and Distribution: Windows 10 64bit

TensorFlow installed from: Latest master source

TensorFlow version: commit dfcec82

Python version: 3.6.5

CMake version: 3.12.0-rc2

MS C+_+ Compiler version: 19.00.24234.1

CPU model and memory: i5-4460 with 16GB of RAM

Exact command to reproduce:

  1. Opening Developer Command Line as admin

  2. Choosing the 64bit compiler

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext\vcvars.bat" amd64

  1. cd D:\opencv\tensorflow\tensorflow\contrib\cmake\build

4.

cmake .. -A x64 -T host=x64 -DCMAKE_BUILD_TYPE=Release -DSWIG_EXECUTABLE=D:/opencv/swigwin-3.0.12/swig.exe -DPYTHON_EXECUTABLE="C:/Users/FiFo/AppData/Local/Programs/Python/Python36/python.exe" -DPYTHON_LIBRARIES="C:/Users/FiFo/AppData/Local/Programs/Python/Python36/libs/python36.lib" -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX2 -Dtensorflow_BUILD_CC_TESTS=OFF -Dtensorflow_BUILD_PYTHON_TESTS=OFF -Dtensorflow_BUILD_MORE_PYTHON_TESTS=OFF -Dtensorflow_BUILD_CC_EXAMPLE=ON -Dtensorflow_BUILD_PYTHON_BINDINGS=ON -Dtensorflow_BUILD_CC_TESTS=OFF -Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=ON -Dtensorflow_ENABLE_MKL_SUPPORT=ON -Dtensorflow_ENABLE_MKLDNN_SUPPORT=ON -Dtensorflow_VERBOSE=ON -Dtensorflow_BUILD_SHARED_LIB=ON
  1. MSBuild /p:Configuration=Release ALL_BUILD.vcxproj SUCCESS
  2. MSBuild /p:Configuration=Release INSTALL.vcxproj SUCCESS

  3. MSBuild /p:Configuration=Release tf_python_build_pip_package.vcxproj

Fails with:

Generating init.py files for Python API.

Traceback (most recent call last):

File "D:\opencv\tensorflow\tensorflow\contrib\cmake\build\tf_python\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper
return importlib.import_module(mname)

File "C:\Users\FiFo\AppData\Local\Programs\Python\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: NÒo foi possÝvel encontrar o m¾dulo especificado.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "D:\opencv\tensorflow\tensorflow\contrib\cmake\build\tf_python\tensorflow\python\pywrap_tensorflow.py", line 58, in 
from tensorflow.python.pywrap_tensorflow_internal import *

File "D:\opencv\tensorflow\tensorflow\contrib\cmake\build\tf_python\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in 
_pywrap_tensorflow_internal = swig_import_helper()

File "D:\opencv\tensorflow\tensorflow\contrib\cmake\build\tf_python\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')

File "C:\Users\FiFo\AppData\Local\Programs\Python\Python36\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)

ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

It used to work before with version 1.8

I don't want to install the PIP version

Compilation works without any problem on Ubuntu 16.04

Mattwmaster58
  • 2,266
  • 3
  • 23
  • 36
Sam
  • 135
  • 1
  • 11
  • https://stackoverflow.com/questions/44080677/no-module-named-pywrap-tensorflow-internal – Bayko Jul 10 '18 at 15:11
  • 1
    I'm compiling for CPU not for GPU another thing, I'm not getting the error while importing I'm getting it while compiling – Sam Jul 10 '18 at 15:21
  • In the tf_python_build_pip_package.vcxproj I found the following command: C:\Program Files\CMake\bin\cmake.exe" -E copy D:/opencv/tensorflow/tensorflow/tools/pip_package/setup.py D:/opencv/tensorflow/tensorflow/contrib/cmake/build/tf_python/ But it doesn't look like the file was copied So I copied it manually and did: python setup.py bdist_wheel Which generated a wheel that I installed with pip install sucessfully But then when I try to import tensorflow it gives me the same error message Any ideas? – Sam Jul 10 '18 at 15:58

1 Answers1

0

CMake is not officially supported anymore. Bazel is the only option that works on all configurations.

Sam
  • 135
  • 1
  • 11