Search code examples
pythontensorflowbazel

bazel-bin/im2txt/run_inference - no such a file


I'm trying im2txt(https://github.com/tensorflow/models/tree/master/research/im2txt) I cloned the repo and downloaded a model. Then wrote a simple shell script for trying im2txt like below.

$ 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}

Result

$ ./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)

Does anyone have any ideas to fix this problem?

Thank you for your help!


Solution

  • bazel build -c opt /im2txt:run_inference

    probably needs to be bazel build -c opt //im2txt:run_inference (double forward slashes)