Error with swig_import_helper and PyModule_Create2 when building tensorflow-serving with bazel - tensorflow

I'm trying to install tensorflow-serving using bazel, and when I run
bazel build tensorflow_serving/...
to build the source tree, I get this error:
ERROR: /home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/external/org_tensorflow/tensorflow/contrib/session_bundle/example/BUILD:38:1: Executing genrule #org_tensorflow//tensorflow/contrib/session_bundle/example:half_plus_two failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Traceback (most recent call last):
File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/tf_serving/../org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.py", line 32, in <module>
import tensorflow as tf
File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 48, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /home/saad/.cache/bazel/_bazel_saad/e37842e738e0e762fe833f8c0caa8761/execroot/serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/contrib/session_bundle/example/export_half_plus_two.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: PyModule_Create2
What do I do?
I'm running python 3.5, gcc/g++ 4.9, CUDA 8.0, have swig installed, and am trying to build on Ubuntu Mate 16.04 with a GTX 1080.
Thanks!

Related

Missing dll tensorflow-gpu

I have anaconda and python installed and I am trying to use tensorflow through command prompt. Can someone help?
(venv)
C:\Users\NeravDOSHI>.\venv\Scripts\activate
(venv)
C:\Users\NeravDOSHI>python --version
Python 3.7.6
(venv)
C:\Users\NeravDOSHI>pip3 --version
pip 20.1 from C:\Users\NeravDOSHI\venv\lib\site-packages\pip (python 3.7)
(venv)
C:\Users\NeravDOSHI>virtualenv --version
virtualenv 20.0.20 from c:\programdata\anaconda3\lib\site-packages\virtualenv\__init__.py
(venv)
C:\Users\NeravDOSHI>pip install --ignore-installed --upgrade
https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.13.1-cp36-cp36m-win_amd64.whl
ERROR: tensorflow-1.13.1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
(venv)
C:\Users\NeravDOSHI>python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "c:\programdata\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "c:\programdata\anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 50, in <module>
from tensorflow.python import pywrap_tensorflow
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 69, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "c:\programdata\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "c:\programdata\anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "c:\programdata\anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
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.
Please follow the instructions from TensorFlow website. I recommend please install Tensorflow 2, if you are using lower versions.
You need to download and install/update the Microsoft Visual C++ 2015-2019 Redistributable (x64) from here.
If you are facing any other issues possible reasons are
Your CPU does not support AVX2 instructions
Your CPU/Python is on 32 bits
There is a library that is in a different location/not installed on your system that cannot be loaded.
Please refer tested build configurations for windows CPU and GPU.

After installing Tensorflow-gpu i got error Failed to load the native TensorFlow runtime

I have installed redhat 6.6, cuda 9.0, cudnn 7.3.1 and tesnorflow-gpu. but after installation getting following error. My graphics card is nvidia titan v
Traceback (most recent call last):
File "<ipython-input-1-88d96843a926>", line 1, in <module>
import keras
File "/root/anaconda3/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/root/anaconda3/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/root/anaconda3/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/root/anaconda3/lib/python3.7/site-packages/keras/backend/__init__.py", line 89, in <module>
from .tensorflow_backend import *
File "/root/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/root/anaconda3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/root/anaconda3/lib/python3.7/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/root/anaconda3/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
Did you tested your installations of cuda and cudnn:
Nvidia drivers:
$ nvidia-smi
This should display you an overview of the metrics of your GPU
Test cuda:
Check first if:
$ nvcc -V
display the right version of your cuda toolkit
Then you can test it with the following process:
First:
$ cd ~/NVIDIA_CUDA-9.0_Samples
$ make
And then:
$ cd ~/NVIDIA_CUDA-10.0_Samples/bin/x86_64/linux/release
$./deviceQuery
if you have a 'Result: pass' at the end, you're all good!
To test cudnn:
$ cp -r /usr/src/cudnn_samples_v7/ $HOME
$ cd $HOME/cudnn_samples_v7/mnistCUDNN
$ make clean && make
$ ./mnistCUDNN
You should have as result: 'Test passed!'
Tensorflow:
If cuda and cudnn are working, i advice you to install tensorflow in a conda environment using:
conda create --name tf_gpu tensorflow-gpu
For me (and after a lot of problems) it was working very well.
To test it:
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
main sources:
install tensorflow GPU
tensorflow for GPU made easy

Tensorflow 2.0.: ImportError: DLL load failed: The specified module could not be found

I just installed tensorflow 2.0 using the pip command:
pip install tensorflow-gpu==2.0.0-alpha0
The import error is shown as follows:
import tensorflow as tf
Traceback (most recent call last):
File "<ipython-input-1-64156d691fe5>", line 1, in <module>
import tensorflow as tf
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\__init__.py", line 27, in <module>
from tensorflow._api.v2 import audio
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\_api\v2\audio\__init__.py", line 8, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Anaconda\Anaconda3.7\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Anaconda\Anaconda3.7\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
The installation was done on the Windows 10 with python 3.7.1, and cuda 9.0.
I have successfully installed tensorflow-gpu 1.13 on my pc in the python 3.5 environment. It seems tensorflow 2.0 is compatible with python 3.7 Ultimate Guide to TensorFlow 2.0 in Python?
TF2.0 was built with CUDA 10 in mind. source
You either can install CUDA 10.0 with cuDNN SDK (>= 7.4.1) or build Tensorflow from sourse.

Tensorflow-alpha-gpu issue ImportError: DLL load failed: The specified module could not be found

I previously had cuda9.0_0 and cudnn7.1.4, I wanted to run tf-alpha in gpu,from this tf guide:https://www.tensorflow.org/install/gpu I found I need cuDNN SDK (>= 7.4.1) and cuda10.so I uninstalled previous versions from control panel and installed Cuda compilation tools, release 10.1, V10.1.105.So, I should have imported tf succesfully,but not,I got the error.
And if I had
conda list cudnn
I got
# packages in environment at F:\Anaconda:
#
# Name Version Build Channel
cudnn 7.1.4 cuda9.0_0 anaconda
Though I installed cuda 10 and cudnn succesfully verified by running
nvcc --version
I have anaconda installed and had previous cuda and I used tf 1.12.0 gpu ago and my gpu is nvidia 1050ti
import tensorflow as tf
I expected it to import tensorflow 2.0 alpha gpu version
The error I got:
Traceback (most recent call last):
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,
description)
File "F:\Anaconda\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "F:\Anaconda\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "F:\Anaconda\lib\site-packages\tensorflow\__init__.py", line 27, in
<module>
from tensorflow._api.v2 import audio
File "F:\Anaconda\lib\site-packages\tensorflow\_api\v2\audio
\__init__.py", line 8, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "F:\Anaconda\lib\site-packages\tensorflow\python\__init__.py", line
49, in <module>
from tensorflow.python import pywrap_tensorflow
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,
description)
File "F:\Anaconda\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "F:\Anaconda\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
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.
my python version is 3.6.6
Note:
TensorFlow Version >= 1.13 requires CUDA 10.0 and TensorFlow Version < 1.13 (till TF 1.5) requires CUDA 9.0.
See Software requirements to know more https://www.tensorflow.org/install/gpu#software_requirements
Also requires NVIDIA® GPU card with CUDA® Compute Capability 3.5 or higher.
See Hardware requirements to know more
https://www.tensorflow.org/install/gpu#hardware_requirements
Hope this helps.

bazel.rc seems take no effect when build tensorflow-serving r1.10 or r1.11

I am building tensorflow-serving r1.10; since my centos7 default python version is 2.7.13 and I want to build with python3.6, so I changed the PYTHON_BIN_PATH in tools/bazel.rc like this.[The python3.6 env is installed with pyenv]
build --action_env PYTHON_BIN_PATH="/home/pyenv/.pyenv/versions/tensorflow-serving/bin/python"
build --define PYTHON_BIN_PATH=/home/pyenv/.pyenv/versions/tensorflow-serving/bin/python
It had been worked when I build tensorflow-serving r 1.9 before. but now, It does not work, so it is the problem with tensorflow-serving r1.11
ERROR: /home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/external/org_tensorflow/tensorflow/BUILD:581:1: Executing genrule #org_tensorflow//tensorflow:tensorflow_python_api_gen failed (Exit 1): bash failed: error executing command
(cd /home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving && \
exec env - \
PATH=/home/pyenv/.pyenv/plugins/pyenv-virtualenv/shims:/home/pyenv/.pyenv/shims:/home/pyenv/.pyenv/bin:/usr/local/ffmpeg/bin/:/opt/jdk1.8.0_112/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/pyenv/.local/bin:/home/pyenv/bin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api --root_init_template=external/org_tensorflow/tensorflow/api_template.__init__.py --apidir=bazel-out/host/genfiles/external/org_tensorflow/tensorflow --apiname=tensorflow --apiversion=2 --package=tensorflow.python --output_package=tensorflow bazel-out/host/genfiles/external/org_tensorflow/tensorflow/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/app/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/bitwise/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/compat/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/data/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/debugging/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/distributions/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/distributions/bijectors/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/dtypes/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/errors/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/feature_column/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/gfile/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/graph_util/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/image/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/io/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/initializers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/activations/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/densenet/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/inception_resnet_v2/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/inception_v3/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/mobilenet/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/nasnet/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/resnet50/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/vgg16/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/vgg19/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/applications/xception/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/backend/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/callbacks/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/constraints/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/boston_housing/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/cifar10/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/cifar100/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/fashion_mnist/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/imdb/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/mnist/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/datasets/reuters/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/estimator/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/initializers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/layers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/losses/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/metrics/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/models/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/optimizers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/preprocessing/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/preprocessing/image/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/preprocessing/sequence/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/preprocessing/text/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/regularizers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/utils/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/wrappers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/keras/wrappers/scikit_learn/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/layers/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/linalg/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/logging/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/losses/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/manip/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/math/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/metrics/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/nn/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/nn/rnn_cell/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/profiler/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/python_io/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/quantization/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/resource_loader/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/strings/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/builder/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/constants/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/loader/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/main_op/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/signature_constants/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/signature_def_utils/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/tag_constants/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/saved_model/utils/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/sets/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/sparse/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/spectral/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/summary/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/sysconfig/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/test/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/train/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/train/queue_runner/__init__.py bazel-out/host/genfiles/external/org_tensorflow/tensorflow/user_ops/__init__.py')
Traceback (most recent call last):
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in <module>
from tensorflow.python.tools.api.generator import doc_srcs
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.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)
ImportError: /home/pyenv/.cache/bazel/_bazel_pyenv/73f8d77da757234474f166b154bb24f7/execroot/tf_serving/bazel-out/host/bin/external/org_tensorflow/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: _Py_FalseStruct
There even no PYTHON_BIN_PATH in the exec command.
I know tensorflow-serving r1.10 should build with bazel0.15 +, So what happend here? how do I change bazel.rc to specify my python path ?
It's hard to tell without a minimal, complete, and veriafiable example. Perhaps bazel isn't picking up on your workspace for some reason?
One thing you can try is using a .bazelrc file instead:
https://docs.bazel.build/versions/master/best-practices.html#bazelrc