How to increase training steps in Tensorflow?

208 views Asked by At

I followed the following Tensorflow tutorial to retrain the Inception V3 on my own classes.

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. 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? If yes, how can I do so?

Thank you for your help!

1

There are 1 answers

0
AudioBubble On

As explained in this link,

The simplest one to try is --how_many_training_steps. This defaults to 4,000, but if you increase it to 8,000 it will train for twice as long.

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