diff --git a/train_ssd.py b/train_ssd.py index a6c09a8..5111144 100644 --- a/train_ssd.py +++ b/train_ssd.py @@ -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.') diff --git a/utility/scaffolds.py b/utility/scaffolds.py index 820dabb..13ac082 100644 --- a/utility/scaffolds.py +++ b/utility/scaffolds.py @@ -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(',')]