简体   繁体   English

如何在 Tensorflow 中增加训练步骤?

[英]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.

相关问题 如何减少 Tensorflow 的对象检测 API 中的训练步骤数? - How to reduce the number of training steps in Tensorflow's Object Detection API? Tensorflow:在训练步骤中延迟变量 - Tensorflow: Delay variable over training steps 提高 I/O bound tensorflow 训练速度 - Increase I/O bound tensorflow training speed 在使用Tensorflow对象检测API进行训练时,我如何知道步骤总数? - How do I know the total number of steps while training using Tensorflow Object Detection API? 如何提高LSTM训练的准确性 - How to increase accuracy of lstm training Tensorflow训练,如何防止训练节点删除 - Tensorflow training, how to prevent training node deletion 在使用 Tensorflow 对象检测 API 训练一定数量的步骤后更改配置文件中的训练参数 - Change training parameters in the config file after training for a certain number of steps using the Tensorflow Object Detection API 如何将我的训练数据上传到谷歌以进行 Tensorflow 云训练 - How to upload my training data into google for Tensorflow cloud training 在训练过程中如何在Tensorflow Python中打印训练损失 - How to print training loss in tensorflow python during training process Gensim等同于培训步骤 - Gensim equivalent of training steps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM