解决TensorFlow最新代码编译错误问题

老是有个习惯,看到开源代码更新了,总是想更新到最新版,如果置之不理的话,就感觉自己懒惰了或有的不负责任了,这个也可能是一种形式的强迫症吧;

前几天晚上git pull TensorFlow,完事后也没去理它,这两天想起来还是做事有头有尾吧, 也想把学习重点转入到TensorFlow,动手玩玩才有感觉嘛^_^。按照Image Recognition https://www.tensorflow.org/tutorials/image_recognition先编译下,其实这个label_image我已经编译了无数次了;但这次是想retrain image,

How to Retrain Inception's Final Layer for New Categories

不废话了,进入正题;

bazel build tensorflow/examples/label_image/...

但这次编译时,突然冒出一堆的错误:

ERROR: /media/berli/DataCenter/Test/tensorflow/tensorflow/BUILD:399:12: Label '//tensorflow:tools/integration_tests/gcs_smoke_test/gcs_smoke.py' crosses boundary of subpackage 'tensorflow/tools/integration_tests/gcs_smoke_test' (perhaps you meant to put the colon here: '//tensorflow/tools/integration_tests/gcs_smoke_test:gcs_smoke.py'?)

ERROR: /media/berli/DataCenter/Test/tensorflow/tensorflow/BUILD:399:12: Label '//tensorflow:tools/integration_tests/gcs_smoke_test/setup.sh' crosses boundary of subpackage 'tensorflow/tools/integration_tests/gcs_smoke_test' (perhaps you meant to put the colon here: '//tensorflow/tools/integration_tests/gcs_smoke_test:setup.sh'?)

ERROR: /media/berli/DataCenter/Test/tensorflow/tensorflow/BUILD:399:12: Label '//tensorflow:tools/integration_tests/gcs_smoke_test/BUILD.bazel' crosses boundary of subpackage 'tensorflow/tools/integration_tests/gcs_smoke_test' (perhaps you meant to put the colon here: '//tensorflow/tools/integration_tests/gcs_smoke_test:BUILD.bazel'?)

ERROR: /media/berli/DataCenter/Test/tensorflow/tensorflow/BUILD:399:12: Label '//tensorflow:tools/integration_tests/gcs_smoke_test/teardown.sh' crosses boundary of subpackage 'tensorflow/tools/integration_tests/gcs_smoke_test' (perhaps you meant to put the colon here: '//tensorflow/tools/integration_tests/gcs_smoke_test:teardown.sh'?)

ERROR: /media/berli/DataCenter/Test/tensorflow/tensorflow/BUILD:399:12: Label '//tensorflow:tools/integration_tests/gcs_smoke_test/test_wrapper.sh' crosses boundary of subpackage 'tensorflow/tools/integration_tests/gcs

让额有点猝不及防。。。;清楚下cache和缓存

bazel clean;rm -rf  ~/.cache

再试试还是一样的错误!我们总是不想把时间花在这种按照调试的问题上,要用在模型,算法上,对,刀刃上,刀刃上啊!但不解决又不行,嗯,google遍查互联网,就是想找到同样错误,又能给出简明扼要的解决方式,最好是一个命令,别他们一堆一堆的邮件,BB的不知道啥内容,说实话,浪费时间,也没心情陪你们玩。

苦心人终不负,百二秦关終属楚!最好终于找到原因:就是google最新的TensorFlow代码已经不兼容低版本bazel编译器了!!可我的bazel是0.8.0,也不低啊

sudo apt-get update ;sudo apt-get upgrade bazel

升级后我们检查bazel version,下面命令

bazel version

Build label: 0.11.0

Build target: bazel-out/k8-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar

Build time: Thu Nov 9 04:43:10 +50056 (1517474666590)

Build timestamp: 1517474666590Build timestamp as int: 1517474666590

嗯 ,继续编译lable_imagebazel build tensorflow/examples/label_image/...

successfully!!!!!

查看原文:http://www.mtcnn.com/?p=206

原文地址:https://www.cnblogs.com/mtcnn/p/9410018.html