[英]How to increase training steps in Tensorflow?
I followed the following Tensorflow tutorial to retrain the Inception V3 on my own classes.我按照以下 Tensorflow 教程在我自己的课程中重新训练了 Inception V3。
https://www.tensorflow.org/hub/tutorials/image_retraining https://www.tensorflow.org/hub/tutorials/image_retraining
Everything worked well so far and I got an acceptable final test accuracy.到目前为止一切运行良好,我得到了可接受的最终测试准确度。 However, I want to improve the result by increasing the training the steps.
但是,我想通过增加训练步骤来改善结果。 I trained the model for 4000 steps and I want to increase it to 8000 steps.
我训练了 4000 步的模型,我想将其增加到 8000 步。 How can I do that without starting the training all over again?
如果不重新开始训练,我怎么能做到这一点?
I have read so many documents about saving and restoring checkpoints but I could not understand how to use them.我已经阅读了很多关于保存和恢复检查点的文档,但我不明白如何使用它们。 Should I modify the retain.py to allow continuation of the training?
我应该修改 retain.py 以允许继续培训吗? If yes, how can I do so?
如果是,我该怎么做?
Thank you for your help!感谢您的帮助!
As explained in this link ,正如此链接中所述,
The simplest one to try is --how_many_training_steps.
最简单的尝试是--how_many_training_steps。 This defaults to 4,000, but if you increase it to 8,000 it will train for twice as long.
默认为 4,000,但如果将其增加到 8,000,它将训练两倍的时间。
To achieve this, run the command,要实现这一点,请运行命令,
python retrain.py --image_dir ~/flower_photos --how_many_training_steps 8000
If you want to get the list of all the available parameters run the command, python retrain.py -h
.如果要获取所有可用参数的列表,请运行命令
python retrain.py -h
。 Below mentioned is the list.下面提到的是列表。
usage: retrain.py [-h] [--image_dir IMAGE_DIR] [--output_graph OUTPUT_GRAPH]
[--intermediate_output_graphs_dir INTERMEDIATE_OUTPUT_GRAPHS_DIR]
[--intermediate_store_frequency INTERMEDIATE_STORE_FREQUENCY]
[--output_labels OUTPUT_LABELS]
[--summaries_dir SUMMARIES_DIR]
[--how_many_training_steps HOW_MANY_TRAINING_STEPS]
[--learning_rate LEARNING_RATE]
[--testing_percentage TESTING_PERCENTAGE]
[--validation_percentage VALIDATION_PERCENTAGE]
[--eval_step_interval EVAL_STEP_INTERVAL]
[--train_batch_size TRAIN_BATCH_SIZE]
[--test_batch_size TEST_BATCH_SIZE]
[--validation_batch_size VALIDATION_BATCH_SIZE]
[--print_misclassified_test_images]
[--bottleneck_dir BOTTLENECK_DIR]
[--final_tensor_name FINAL_TENSOR_NAME] [--flip_left_right]
[--random_crop RANDOM_CROP] [--random_scale RANDOM_SCALE]
[--random_brightness RANDOM_BRIGHTNESS]
[--tfhub_module TFHUB_MODULE]
[--saved_model_dir SAVED_MODEL_DIR]
[--logging_verbosity {DEBUG,INFO,WARN,ERROR,FATAL}]
[--checkpoint_path CHECKPOINT_PATH]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.