Просмотр исходного кода

Merge pull request #1185 from cshallue/master

Small clarification to documentation
Chris Shallue 8 лет назад
Родитель
Сommit
8a22c8ae3d
2 измененных файлов с 9 добавлено и 3 удалено
  1. 7 3
      im2txt/README.md
  2. 2 0
      im2txt/im2txt/run_inference.py

+ 7 - 3
im2txt/README.md

@@ -296,8 +296,12 @@ Your trained *Show and Tell* model can generate captions for any JPEG image! The
 following command line will generate captions for an image from the test set.
 following command line will generate captions for an image from the test set.
 
 
 ```shell
 ```shell
-# Directory containing model checkpoints.
-CHECKPOINT_DIR="${HOME}/im2txt/model/train"
+# Path to checkpoint file or a directory containing checkpoint files. Passing
+# a directory will only work if there is also a file named 'checkpoint' which
+# lists the available checkpoints in the directory. It will not work if you
+# point to a directory with just a copy of a model checkpoint: in that case,
+# you will need to pass the checkpoint path explicitly.
+CHECKPOINT_PATH="${HOME}/im2txt/model/train"
 
 
 # Vocabulary file generated by the preprocessing script.
 # Vocabulary file generated by the preprocessing script.
 VOCAB_FILE="${HOME}/im2txt/data/mscoco/word_counts.txt"
 VOCAB_FILE="${HOME}/im2txt/data/mscoco/word_counts.txt"
@@ -314,7 +318,7 @@ export CUDA_VISIBLE_DEVICES=""
 
 
 # Run inference to generate captions.
 # Run inference to generate captions.
 bazel-bin/im2txt/run_inference \
 bazel-bin/im2txt/run_inference \
-  --checkpoint_path=${CHECKPOINT_DIR} \
+  --checkpoint_path=${CHECKPOINT_PATH} \
   --vocab_file=${VOCAB_FILE} \
   --vocab_file=${VOCAB_FILE} \
   --input_files=${IMAGE_FILE}
   --input_files=${IMAGE_FILE}
 ```
 ```

+ 2 - 0
im2txt/im2txt/run_inference.py

@@ -39,6 +39,8 @@ tf.flags.DEFINE_string("input_files", "",
                        "File pattern or comma-separated list of file patterns "
                        "File pattern or comma-separated list of file patterns "
                        "of image files.")
                        "of image files.")
 
 
+tf.logging.set_verbosity(tf.logging.INFO)
+
 
 
 def main(_):
 def main(_):
   # Build the inference graph.
   # Build the inference graph.