TensorFlow: Extension file not found: 'google/protobuf/protobuf.bzl' - tensorflow

I am following this tutorial to install GPU-enabled TensorFlow that is compatible with CUDA Compute Capability 3.0.
I installed Java-JDK8, Bazel 0.1.0, TensorFlow 0.6.0, and changed the configurations to run on CUDA Compute Capability 3.0. Everything is good so far.
But when I enter this command:
$HOME/bin/bazel build -c opt --config=cuda
//tensorflow/cc:tutorials_example_trainer
I see this output:
Extracting Bazel installation...
.....
ERROR: /home/me/tensorflow/tensorflow/core/BUILD:1: Extension file not found: 'google/protobuf/protobuf.bzl'.
ERROR: /home/me/tensorflow/tensorflow/cc/BUILD:65:1: error loading package 'tensorflow/core': Extension file not found: 'google/protobuf/protobuf.bzl' and referenced by '//tensorflow/cc:tutorials_example_trainer'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 1.006s
Any advice?

The problem is fixed by running this command:
$ git clone -b 0.6.0 –recurse-submodules https://github.com/tensorflow/tensorflow.git
The error message I received is documented here. Pulling all submodules fixed the problem.

I've had issues with the command above, -recurse-submodules does not exist
Try this:
$ git clone --recursive git#github.com:tensorflow/tensorflow.git

Related

Error in TensorFlow 1.15.X Source Compile in Highwayhash package building

I'm trying compiling Tensorflow 1.15 on Odroid-XU4 and getted some error that seems not related and exclusive to my platform. I installed Tensorflow 1.13 by source compile successfully. But for TF1.15 I got some error which experienced when use TF1.15.0 and TF1.15.1 and TF1.15.3.
My command to build using Bazel 0.26.1 is:
bazel --output_base=/media/odroid/.../CacheFolder build --config=opt --config=monolithic --config=noaws --jobs 1 --define=grpc_no_ares=true --local_resources 1536,0.5,1.0 tensorflow:libtensorflow_cc.so --discard_analysis_cache
After getting error for package "#io_rules_docker" which fixed by adding manually in WORKSPACEFILE and some same error I got this error:
>no such package '#highwayhash//': BUILD file not found on package path and referenced by '//tensorflow/core/platform/default/build_config:platformlib'
How can I solve this?

Does compilation start from beginning or resume after fixing error while building Tensorflow from source?

I need to compile Tensorflow from source for compute capability 3.0
I was compiling Tensorflow and I got this error after 6 hours of compiling:
cache/bazel/_bazel_maydin/435ff134a8a529ccec16636685173684/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_2_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/keras/preprocessing/__init__.py", line 21, in <module>
import keras_preprocessing
ModuleNotFoundError: No module named 'keras_preprocessing'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 20674.165s, Critical Path: 247.43s
INFO: 12297 processes: 12297 local.
FAILED: Build did NOT complete successfully
In below link, I found this answer and I think it will work.
Error Compiling Tensorflow From Source - No module named 'keras_applications'
pip install keras_applications==1.0.4 --no-deps
pip install keras_preprocessing==1.0.2 --no-deps
pip install h5py==2.8.0
I also got similar error before beginning of build where it says numpy is missing, i just installed it via pip and build started without problem.
But I am scared to run build command again. Because I don't want to compile everything 6 hours again.
If I start building again does it start all over from beginning or it continue from where it failed?
Build command I used is this:
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
I cloned tensorflow repository, checkout to branch 2.0 and started build.
Additional info about system:
Cuda 10.0.130
cuDNN 7.6.2
Bazel 0.26.1
Ubuntu 18.04
It resumes compiling where it left off after fixing errors.

`no such package` when compiling TensorFlow

I'm currently experiencing problems with compiling TensorFlow. It looks like there are problems downloading certain packages, as mentioned here, however the last mention of the bug was in September. What is wrong? I simply cloned the latest r1.5 branch, ran ./configure and tried to compile. I'm using cuda 9.1 with cudnn 7.
bazel build --config=opt --config=cuda --config=mkl //tensorflow/tools/pip_package:build_pip_package
........
ERROR: /home/mv310/projects/tensorflow/tensorflow/tools/pip_package/BUILD:28:1: no such package 'third_party/eigen3': error globbing [**/*]: /home/mv310/projects/tensorflow/third_party/eigen3/mkl_include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include (Too many levels of symbolic links) and referenced by '//tensorflow/tools/pip_package:included_headers_gather'
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: no such package 'third_party/eigen3': error globbing [**/*]: /home/mv310/projects/tensorflow/third_party/eigen3/mkl_include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include/include (Too many levels of symbolic links)
INFO: Elapsed time: 10.798s
FAILED: Build did NOT complete successfully (37 packages loaded)
currently loading: tensorflow/core ... (11 packages)
Could you try removing mkl_include dir and build again?
I was working in the models project. My issue was a leftover directory from a previous install. Deleting the directory and doing a fresh clone helped.
rm -r -f models/research/syntaxnet/tensorflow
git pull --recurse
cd tensorflow
./configure
In the tensorflow directory, I think you can also stash your changes and do a hard reset too.
git stash
git reset --hard HEAD
Finally, if all else fails, clean your bazel cache
rm -r -f ~/.cache/bazel/*

Tensorflow Custom Compile on Windows

So, I've installed Bazel via Chocolatey, installed Python 3.5 and 2.7, installed CUDA v8, and cuDNN v6, and installed JDK 8.0, I'm now trying to custom-build TensorFlow on my Windows 10 device, with AVX, AVX 2 and CUDA. TensorFlow-GPU, the pre-built version, does work, I've already tested and run that successfully.
I've followed the instructions of other articles, both on TensorFlows' actual site (trying to adapt some sections from the Linux/Mac installs), and on here. The furthest I've made it is; cloning the Github repository via Msys2, running configure.py, then attempting to build via bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package I receive an error, the header of which is:
Error reading java.io.IOException: CreateProcess(): The system cannot find the file specified.
: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include/cudnn.h
I've double checked, that file does exist, so I'm not sure why I'm getting this error.
EDIT: Also attempted to run via Powershell, reached the same point.
Any help would be much appreciated.
I had the exact same error while trying to build Tensorflow on Windows (using cuDNN 5.1). I fixed it by launching bazel from the msys2 terminal (instead of from the windows command prompt) and manually setting the BAZEL_SH environment variable before attempting to build.
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
bazel build -c opt --config=win-cuda tensorflow/cc:cc_ops
The following steps helped me to compile Tensorflow on Windows 10.
pacman -Syuu patch
ln -s "c:\python27\python.exe" /usr/bin/python
export BAZEL_SH=c:/tools/msys64/usr/bin/bash.exe
"C:\Documents and Settings\All Users\chocolatey\bin\bazel.exe" build --config=opt --config=win-cuda //tensorflow/tools/pip_package:build_pip_package
But after 1 hour of compilation I got another error:
C:\tools\msys64\tmp_bazel_dmitry\x1e5egqw\execroot\org_tensorflow\external\protobuf_archive\python\google\protobuf\internal\api_implementation.cc
: fatal error C1083: Cannot open compiler generated file: '': Invalid
argument Target //tensorflow/tools/pip_package:build_pip_package
failed to build

Error while building tensorflow

I am getting 'autoreconf missing error' while building tensorflow from android studio.
OS: MacOs Sierra.
+ autoreconf -f -i -Wall,no-obsolete
./autogen.sh: line 48: autoreconf: command not found
:TensorFlow-Android-Inference:buildTensorflow FAILED
FAILURE: Build failed with an exception.
How can I fix this?
Tried brew install autoconf but it didn't work.
SOLUTION: fix task buildTensorflow's environment line (added /usr/local/bin:)
Solved by the OP: The task in which you build TensorFlow needed to have /usr/local/bin in the PATH for task buildTensorflow's environment.