Can't start tensorflow with bazel

I am trying to run tensorflow using Bazel on my supported mac cpu.

I ran the following command:

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

      

and this throws the following error:

ERROR: / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflow-master / tensorflow / core / assemblies: 1 323: 1: no such target '// tensorflow / tools / git: gen / spec.json': target 'gen / spec.json' is not declared in package 'tensorflow / tools / git' is defined from / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflowMaster / tensorflow / tools / git / BUILD and is referenced from '// tensorflow / core: version_info_gen '. ERROR: / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflow-master / tensorflow / core / assemblies: 1 323: 1: no target '// tensorflow / tools / git: gen / head': target 'gen / head 'is not declared in the package "tensorflow / tools / git" defined by / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflowMaster / tensorflow / tools / git / BUILD and refers to' // tensorflow / core: version_info_gen '... ERROR: / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflow-master / tensorflow / core / assemblies: 1 323: 1: no target '// tensorflow / tools / git: gen / branch_ref': target 'gen / branch_ref 'is not declared in package' tensorflow / tools / git 'is defined by / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflowMaster / tensorflow / tools / git / BUILD and refers to' // tensorflow / core: version_info_gen '. ERROR: Parsing target '// tensorflow / tools / pip_package: build_pip_package' failed; build aborted.defines / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflow-master / tensorflow / tools / git / BUILD and links to '// tensorflow / core: version_info_gen'. ERROR: Parsing target '// tensorflow / tools / pip_package: build_pip_package' failed; build aborted.defines / Users / Rocky / Downloads / Experiment / TensorFlow / tensorflow-master / tensorflow / tools / git / BUILD and links to '// tensorflow / core: version_info_gen'. ERROR: Parsing target '// tensorflow / tools / pip_package: build_pip_package' failed; build aborted.

How can I sort this out?

+3


source to share


2 answers


I had the same problem, when I ran the following command, I solved the problem:

./configure

      



I used all the default configurations. Check out the issue for more information .

+4


source


(Tried to comment but I don't have enough karma. Then post this as an answer.)

The error message informs you that the build rule refers to a target that does not exist, or the rule does not have access to it.

What is the result of the following command? cd

to your TensorFlow project directory where you have the file WORKSPACE

and run it from there):



bazel query --output=build 'somepath("//tensorflow/core:version_info_gen",  "//tensorflow/tools/git:gen/spec.json")'

      

also:

  • Which version of Bazel are you using?
  • Which TensorFlow commit have you tested?
  • Have you changed something in the source tree?
+2


source







All Articles