简体   繁体   中英

Error when running TensorFlow image retraining tutorial

I have a very basic question about TensorFlow. I'm following the "TensorFlow for Poets" tutorial , and I'm stuck at the image retraining, when I try to run this command:

# python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/flower_photos

I got an error: "--bottleneck_dir=/tf_files/bottlenecks: No such file or directory"

I have installed TensorFlow using Anaconda installation, and I didn't install Docker as it was recommended in the codelab tutorial. So my question is what am I doing wrong? Is it necessary to install Docker Toolbox?

From the error message, it looks like you have pasted the exact command from your question (and from the original tutorial) into the shell, and the # at the beginning was interpreted as a comment, and it's trying to execute the second line as a command.

If you paste the command without the # , it should work:

python tensorflow/examples/image_retraining/retrain.py \
--bottleneck_dir=/tf_files/bottlenecks \
--how_many_training_steps 500 \
--model_dir=/tf_files/inception \
--output_graph=/tf_files/retrained_graph.pb \
--output_labels=/tf_files/retrained_labels.txt \
--image_dir /tf_files/flower_photos

This looks like a bug in the tutorial—the second command on the same page doesn't have the # —so I've filed a GitHub issue to get this fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM