解決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!!!!!