0
votes

After configuring tensorflow i run :

$ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package 

and I get :

WARNING: /home/f390/tensorflow/tensorflow/core/BUILD:1634:1: in includes attribute of cc_library rule //tensorflow/core:framework_headers_lib: '../../external/nsync/public' resolves to 'external/nsync/public' not below the relative path of its package 'tensorflow/core'. This will be an error in the future. Since this rule was created by the macro 'cc_header_only_library', the error might have been caused by the macro implementation in /home/f390/tensorflow/tensorflow/tensorflow.bzl:911:30 WARNING: /home/f390/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': No longer supported. Switch to SavedModel immediately. WARNING: /home/f390/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': No longer supported. Switch to SavedModel immediately. INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (0 packages loaded). INFO: Found 1 target... ERROR: /home/f390/.cache/bazel/_bazel_f390/1eade5de15db7071cc11285c76340430/external/protobuf_archive/BUILD:263:1: C++ compilation of rule '@protobuf_archive//:js_embed' failed (Exit 127) /usr/bin/env: 'python\r': No such file or directory 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: 7.493s, Critical Path: 0.18s FAILED: Build did NOT complete successfully

How to fix this error?

1
Did you run ./configure before that? - E_net4 the commentary remover
What version of tensorflow are you building? Does it also happen at HEAD? What version of bazel do you use? - hlopko
yes I did ./configure. I am trying to build branch r1.3 - Hardik Gupta

1 Answers

0
votes

This problem also appear during building tensorflow 2 for python3. According to this issue, the problem is that bazel have python2 as dependency. The easiest way to fix it is just install python2 on your machine with apt (worked for me):

sudo apt install python

Or if you do not want install extra package you can try special flag for bazel build as suggested in this answer:

'--noincompatible_strict_action_env'