Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for training model from scratch #1

Merged
merged 1 commit into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion train_ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
# checkpoint related configuration
tf.app.flags.DEFINE_string(
'checkpoint_path', './model',
'The path to a checkpoint from which to fine-tune.')
'The path to a checkpoint from which to fine-tune. If it is None, training model from scratch.')
tf.app.flags.DEFINE_string(
'checkpoint_model_scope', 'vgg_16',
'Model scope in the checkpoint. None if the same as the trained model.')
Expand Down
3 changes: 3 additions & 0 deletions utility/scaffolds.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def get_init_fn_for_scaffold(model_dir, checkpoint_path, model_scope, checkpoint
if tf.train.latest_checkpoint(model_dir):
tf.logging.info('Ignoring --checkpoint_path because a checkpoint already exists in %s.' % model_dir)
return None
if checkpoint_path is None:
tf.logging.info('Training detector from scratch.')
return None
exclusion_scopes = []
if checkpoint_exclude_scopes:
exclusion_scopes = [scope.strip() for scope in checkpoint_exclude_scopes.split(',')]
Expand Down