简体   繁体   中英

ERROR:tensorflow:Couldn't understand architecture name ''

I'm following the instruction from google code lab

When I ran the following command I got some error.

python -m scripts.retrain \
    --bottleneck_dir=tf_files/bottlenecks \
    --how_many_training_steps=500 \
    --model_dir=tf_files/models/ \
    --summaries_dir=tf_files/training_summaries/"${ARCHITECTURE}" \
    --output_graph=tf_files/retrained_graph.pb \
    --output_labels=tf_files/retrained_labels.txt \
    --architecture="${ARCHITECTURE}" \
    --image_dir=tf_files/flower_photos

the error are

ERROR:tensorflow:Couldn't understand architecture name ''
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/nutron/Documents/android-codelab-projects/google-codelab-tensorflow-for-poets-2/scripts/retrain.py", line 1326, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/Users/nutron/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/Users/nutron/Documents/android-codelab-projects/google-codelab-tensorflow-for-poets-2/scripts/retrain.py", line 976, in main
    model_info = create_model_info(FLAGS.architecture)
  File "/Users/nutron/Documents/android-codelab-projects/google-codelab-tensorflow-for-poets-2/scripts/retrain.py", line 923, in create_model_info
    raise ValueError('Unknown architecture', architecture)
ValueError: ('Unknown architecture', '')

What I did it wrong or what should I do?

Thanks

Apparently, the error happened because ARCHITECTURE was not set. You probably missed the step "Configure your MobileNet" in the doc. Please run the following command:

IMAGE_SIZE=224
ARCHITECTURE="mobilenet_0.50_${IMAGE_SIZE}"

before python -m scripts.retrain ... .

For Windows:

SET IMAGE_SIZE=224<br/>
SET ARCHITECTURE="mobilenet_0.50_%IMAGE_SIZE%"

-

python -m scripts.retrain \
--bottleneck_dir=tf_files/bottlenecks \
--how_many_training_steps=500 \
--model_dir=tf_files/models/ \
--summaries_dir=tf_files/training_summaries/%ARCHITECTURE% \
--output_graph=tf_files/retrained_graph.pb \
--output_labels=tf_files/retrained_labels.txt \
--architecture="%ARCHITECTURE%" \
--image_dir=tf_files/flower_photos

If Max' answer does not work for you on Linux, Try replacing "${ARCHITECTURE}" with "mobilenet_0.50_224"

python -m scripts.retrain
--bottleneck_dir=tf_files/bottlenecks
--how_many_training_steps=500
--model_dir=tf_files/models/
--summaries_dir=tf_files/training_summaries/"mobilenet_0.50_224"
--output_graph=tf_files/retrained_graph.pb
--output_labels=tf_files/retrained_labels.txt
--architecture="mobilenet_0.50_224"
--image_dir=tf_files/flower_photos

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