我儘量讓this example工作,但每次我嘗試建立與巴澤爾我收到此錯誤信息的程序:巴澤爾沒有找到tensorflow包C++代碼示例
bazel build //code:label_image
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: Analysis of target '//code:label_image' failed; build aborted.
INFO: Elapsed time: 1.261s
我救的確切源代碼從github在一個名爲code
的目錄中。我通過pip:pip3 install --upgrade tensorflow
在(主動)虛擬環境中安裝了tensorflow
。我使用arch linux。
爲什麼bazel找不到合適的包?我對bazel/tensorflow很陌生。這些軟件包在哪裏保存?我必須在某處明確指定它們嗎?
我明白了,謝謝。從github下載完整的項目並在那裏運行示例構建,還是需要事先構建一些東西才能使其工作? – Jonas
是的,如果您還沒有,請按照自述文件中特定於Tensorflow的附加步驟下載模型定義。 – Jin