bazel-bin / im2txt / run_inference - 没有这样的文件

时间:2017-12-27 22:43:01

标签: python tensorflow bazel

我正在尝试im2txt(https://github.com/tensorflow/models/tree/master/research/im2txt) 我克隆了回购并下载了一个模型。然后编写了一个简单的shell脚本,用于尝试下面的im2txt。

$ git clone https://github.com/tensorflow/models.git
$ cd model/research/im2txt

run.sh

CHECKPOINT_PATH="/Users/me/Desktop/machine-learning/ml/models/research/im2txt/im2txt/model/model.ckpt-3000000"
VOCAB_FILE="/Users/me/Desktop/machine-learning/ml/models/research/im2txt/im2txt/data/word_counts.txt"
IMAGE_FILE="/Users/me/Desktop/machine-learning/ml/models/research/im2txt/im2txt/data/COCO_val2014_000000224477.jpg"

bazel build -c opt /im2txt:run_inference

bazel-bin/im2txt/run_inference \
  --checkpoint_path=${CHECKPOINT_PATH} \
  --vocab_file=${VOCAB_FILE} \
  --input_files=${IMAGE_FILE}

结果

$ ./run.sh
INFO: Analysed 0 targets (0 packages loaded).
INFO: Found 0 targets...
INFO: Elapsed time: 0.360s, Critical Path: 0.02s
INFO: Build completed successfully, 1 total action
./run.sh: line 8: bazel-bin/im2txt/run_inference: No such file or directory

的Env

$ bazel version
Build label: 0.9.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sun Jul 12 03:29:57 +49936 (1513677382197)
Build timestamp: 1513677382197
Build timestamp as int: 1513677382197

$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

tensorflow (1.1.0)

有没有人有任何想法来解决这个问题?

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

bazel build -c opt /im2txt:run_inference

可能需要bazel build -c opt //im2txt:run_inference(双正斜杠)