Tensorflow 无法构建 image_retraining:label_image

Tensorflow fails to build image_retraining:label_image

我已经使用 AVX 和 SSE 编译了 TensorFlow(从 git 存储库克隆)。你好,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?

你的 label_image.py 不在这个目录 tensorflow/examples/image_retraining 中,在我的例子中是在 tensorflow/examples/label_image 这个文件夹中。所以试试

bazel build tensorflow/examples/label_image:label_image

希望对您有所帮助。