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?
Related
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?
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.
I need to build tensorflow from source.
After git clone and run the following check command:
bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/lite/...
And I get the following error:
bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/lite/...
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/home/rich/research/installations/tensorflow/tensorflow/tools/bazel.rc
INFO: Invocation ID: 1a1c9f70-531e-49a0-b8e7-9f4d7ab4b24b
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.046s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
Sounds like you are using a bazel version that is too new.
The latest released bazel version according to https://blog.bazel.build/ is 0.22, but the latest bazel version mentioned in the "Tested build configurations" section of https://www.tensorflow.org/install/source is 0.15.0 (used for tensorflow 1.12)
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
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.