fo40225 / tensorflow-windows-wheel

Tensorflow prebuilt binary for Windows
3.66k stars 1.53k forks source link

I build tensorflow myself, but have bellow error, could you please help me? #67

Open bbxfnet opened 5 years ago

bbxfnet commented 5 years ago

ERROR: G:/tensorflow-master/tensorflow/python/keras/api/BUILD:28:1: Executing genrule //tensorflow/python/keras/api:keras_python_api_gen_compat_v1 failed (Exit 1): bash.exe failed: error executing command cd C:/users/administrator/_bazel_administrator/kjfn3bpc/execroot/org_tensorflow SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0 SET CUDNN_INSTALL_PATH=G:/cuda SET PATH=C:\msys64\usr\bin;C:\msys64\bin SET PYTHON_BIN_PATH=C:/Program Files/Python36/python.exe SET PYTHON_LIB_PATH=C:/Program Files/Python36/lib/site-packages SET TF_CUDA_CLANG=0 SET TF_CUDA_COMPUTE_CAPABILITIES=3.0,7.0 SET TF_CUDA_VERSION=10.0 SET TF_CUDNN_VERSION=7 SET TF_NEED_CUDA=1 SET TF_NEED_OPENCL_SYCL=0 SET TF_NEED_ROCM=0 C:/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/x64_windows-opt/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.exe --apidir=bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api_v1/ --apiname=keras --apiversion=1 --package=tensorflow.python,tensorflow.python.keras --output_package=tensorflow.python.keras.api._v1 bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/activations/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/densenet/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_resnet_v2/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_v3/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet_v2/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/nasnet/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/resnet50/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg16/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg19/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/xception/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/backend/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/callbacks/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/constraints/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/boston_housing/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar10/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar100/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/fashion_mnist/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/imdb/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/mnist/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/reuters/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/estimator/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/experimental/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/initializers/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/layers/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/losses/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/metrics/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/models/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/optimizers/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/image/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/sequence/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/text/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/regularizers/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/utils/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/init.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/scikit_learn/init.py Execution platform: @bazel_tools//platforms:host_platform Traceback (most recent call last): File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Program Files\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\tools\api\generator\create_python_api.py", line 27, in from tensorflow.python.tools.api.generator import doc_srcs File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python__init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "\?\C:\Users\ADMINI~1\AppData\Local\Temp\Bazel.runfiles_8d0ttsie\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Program Files\Python36\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: 找不到指定的模块。

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. Target //tensorflow/tools/pip_package:build_pip_package failed to build INFO: Elapsed time: 48.295s, Critical Path: 41.60s INFO: 7 processes: 7 local. FAILED: Build did NOT complete successfully

bbxfnet commented 5 years ago

I have fixed it. Edit the file C:\Program Files\Python36\Lib\imp.py of modify method load_dynamic, put the "PATH" environment variable of system's. def load_dynamic(name, path, file=None): """DEPRECATED

    Load an extension module.
    """
    import importlib.machinery
    loader = importlib.machinery.ExtensionFileLoader(name, path)
    import os
    os.putenv('PATH', r"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Python36\Scripts\;C:\Program Files\Python36\;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\extras\CUPTI\libx64;G:\cuda\bin;C:\msys64\usr\bin;H:\Downloads\icu\bin64;H:\Downloads\icu;H:\Downloads\icu\lib64;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Python36\lib\site-packages\numpy\.libs")

    # Issue #24748: Skip the sys.modules check in _load_module_shim;
    # always load new extension
    spec = importlib.machinery.ModuleSpec(
        name=name, loader=loader, origin=path)
    return _load(spec)
jessiepool commented 4 years ago

Thx a lot. It works on anaconda py3.6. Edit the file **\Anaconda3\Lib\imp.py instead.

liushuainudt commented 4 years ago

I encounter the same problem, solved with solution, especially when you add flag --config=mkl. You need pay special attention to the Similar path "E:\bazel\external\mkl_windows\lib\"