problem building TensorFlow r1.13 from sources - tensorflow

I'm trying to build under Ubuntu 18.04 TensorFlow r1.13 from sources and whichever compatible version of bazel I use I get the same errors:
ERROR: /home/hamlatzis/.cache/bazel/_bazel_hamlatzis/bc20d0623a1a0c4eaa510688c26216cb/external/io_bazel_rules_closure/closure/protobuf/closure_proto_library.bzl:66:21: name 'ProtoInfo' is not defined (did you mean 'protos'?)
ERROR: error loading package '': Extension 'closure/protobuf/closure_proto_library.bzl' has errors
ERROR: error loading package '': Extension 'closure/protobuf/closure_proto_library.bzl' has errors
I need to be on r1.13, but to be on the safe side I've tried with other branches (r1.14 and master) and had no problems with those
Any idea?

Try a different Bazel version.
Bazel 0.21.0 worked for me for Tensorflow r1.13.

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?

Error while building TensorFlow from source

I am trying to build TensorFlow cpu only r1.11 from source on a Debian OS following this tutorial: https://www.tensorflow.org/install/source
I installed bazel as indicated using this tutorial https://docs.bazel.build/versions/master/install-ubuntu.html from the binary installer as recommended.
Then I followed each step and everything worked fine until this command:
bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/lite/...
It shows me this error:
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': The native http_archive rule is deprecated. load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': The native http_archive rule is deprecated. load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") for a drop-in replacement.
Use --incompatible_remove_native_http_archive=false to temporarily continue using the native rule.
INFO: Elapsed time: 0.088s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
I read online that this is likely related to bazel. So I tried reinstalling bazel using the Using Bazel custom APT repository but I got the same error.
As of version 1.12.0, TensorFlow uses some deprecated Bazel features that are being completely dropped in recent versions of Bazel. Instead of using the most recent version, try using an older one for now. I was able to build TensorFlow 1.12.0 on Windows using Bazel 0.18.1, most likely that should work with TensorFlow 1.11 too.
I agree with #jdehesa. Even I was struggling to build the tensorflow using from scratch. I tried different versions, 0.26,0.21,0.19.1 and finally it worked with 0.18.1. So, it is a bazel issue rather than Tensorflow. TF_version=1.12.0

Geting ERROR: Config value cuda is not defined in any .rc file when trying to train mobilenet in tensorflow

I'm trying to run MobileNet_v1 on ImageNet and for that I'm using the official Tensorflow Model repository and following their guide.
However when I actually tried to run the training for MobileNet_v1 by first initiating :
models/research/slim$ bazel build -c opt --config=cuda mobilenet_v1_{eval,train}
I got :
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=146
ERROR: Config value cuda is not defined in any .rc file
All previous steps have been successful and everything seems fine except this one.
I'm using :
Ubuntu 16.04
TF version: v1.7.0 (and 1.10.1)
Cuda v9.0
cuDNN v7.0 (and 7.1.3)
bazel release 0.16.1
According to the bazel releases page,
--[no]allow_undefined_configs no longer exists, passing undefined
configs is an error.
as of version 0.16.0 and above.
Using an older version of bazel should solve your problem for now.

Tensorflow building error

I got this error while building Tensorflow 1.1.0
Starting local Bazel server and connecting to it...
ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/testing/phantomjs_test.bzl:31:10: name 'set' is not defined
ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/private/defs.bzl:27:16: name 'set' is not defined
ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/compiler/closure_js_binary.bzl:216:13: name 'set' is not defined
ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/filegroup_external.bzl:23:16: name 'set' is not defined
ERROR: error loading package '': Extension 'closure/filegroup_external.bzl' has errors
Building: no action
I've used bazel 0.16.0 for this. If this issue is because of not proper version of bazel, which version do I have to use to solve this issue?
You'll need to use Bazel 0.5.4 to build Tensorflow 1.1.0. Please note that 0.5.4 is very old -- it's 0.16.0 as of time of writing this answer.
Do you need to specifically build Tensorflow 1.1.0?

Unable to build TensorFlow from source with bazel. 22nd January 2016

I wanted to install the latest TensorFlow from source. I pulled the repository, and then ran
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
I got this error:
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: First argument of load() is a path, not a label. It should start with a single slash if it is an absolute path.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:10:6: file '/tensorflow:tensorflow.bzl.bzl' was not correctly loaded. Make sure the 'load' statement appears in the global scope in your file.
ERROR: /home/samuelchin/tensorflow/tensorflow/models/embedding/BUILD:104:1: name 'tf_gen_op_wrapper_py' is not defined.
ERROR: /home/samuelchin/tensorflow/tensorflow/tools/pip_package/BUILD:13:1: Target '//tensorflow/models/embedding:package' contains an error and its package is in error and referenced by '//tensorflow/tools/pip_package:build_pip_package'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.071s.
There was a recent change to the TensorFlow BUILD files that causes the dependency on Bazel 0.1.4. This was announced on the discuss#tensorflow.org mailing list, but hasn't made it into the documentation on the website yet.
As you have already discovered, upgrading Bazel to version 0.1.4 should fix this build error.
Turns out that bazel was outdated. The previous version of my bazel was 0.1.2, which was last updated in December. Bazel has since then been updated to 0.1.4. For those who have this error, updating bazel would do the trick. You can then build as per normal.
I guess in future, if it can't build, you might want to check if bazel is updated to the latest version.