Search code examples
pythontensorflowbazel

Unable to run tensorflow using bazel


Im trying to run tensorflow using Bazel in my CPU supported mac.

I ran the following command,

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

and it is throwing the following error

ERROR: /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/core/BUILD:1323:1: no such target '//tensorflow/tools/git:gen/spec.json': target 'gen/spec.json' not declared in package 'tensorflow/tools/git' defined by /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'. ERROR: /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/core/BUILD:1323:1: no such target '//tensorflow/tools/git:gen/head': target 'gen/head' not declared in package 'tensorflow/tools/git' defined by /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'. ERROR: /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/core/BUILD:1323:1: no such target '//tensorflow/tools/git:gen/branch_ref': target 'gen/branch_ref' not declared in package 'tensorflow/tools/git' defined by /Users/Rocky/Downloads/Experiment/TensorFlow/tensorflow-master/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'. ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.

How can I be able to sort this out?


Solution

  • I had the same issue, running the following command solved the problem for me:

    ./configure
    

    I used all the default configurations. Check this issue for more info.