Tensorflow无法构建image_retraining:label_image

时间:2017-12-27 16:04:48

标签: tensorflow bazel

我已经使用AVX和SSE(从git存储库克隆)编译了TensorFlow。 Hello TensorFlow脚本工作,并且不会打印CPU支持二进制文件未编译的指令的警告。

后来我用图像创建了目录并运行了再培训器:

$ bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir ~/mydata

但是当我尝试构建label_image时,我收到了这个错误:

bazel build --config=opt tensorflow/examples/image_retraining:label_image
ERROR: Skipping 'tensorflow/examples/image_retraining:label_image': no such target '//tensorflow/examples/image_retraining:label_image': target 'label_image' not declared in package 'tensorflow/examples/image_retraining' defined by /home/user/myretraining/tensorflow/tensorflow/examples/image_retraining/BUILD
WARNING: Target pattern parsing failed.
ERROR: no such target '//tensorflow/examples/image_retraining:label_image': target 'label_image' not declared in package 'tensorflow/examples/image_retraining' defined by /home/user/myretraining/tensorflow/tensorflow/examples/image_retraining/BUILD
INFO: Elapsed time: 0.118s
FAILED: Build did NOT complete successfully (0 packages loaded)

(/home/user/myretraining is the source dir root)

我做错了什么?如何编译label_image?

1 个答案:

答案 0 :(得分:2)

您的 label_image.py 不在此目录tensorflow / examples / image_retraining中,在我的情况下,它位于tensorflow / examples / label_image这个文件夹中。所以试试

bazel build tensorflow/examples/label_image:label_image
希望它有所帮助。