Change default of frequency
@@ -40,7 +40,7 @@ def main():
help='Number of images in each mini-batch')
parser.add_argument('--epoch', '-e', type=int, default=20,
help='Number of sweeps over the dataset to train')
- parser.add_argument('--frequency', '-f', type=int, default=20,
+ parser.add_argument('--frequency', '-f', type=int, default=-1,
help='Frequency of taking a snapshot')
parser.add_argument('--gpu', '-g', type=int, default=-1,
help='GPU ID (negative value indicates CPU)')
@@ -89,7 +89,8 @@ def main():
trainer.extend(extensions.dump_graph('main/loss'))
# Take a snapshot for each specified epoch
- trainer.extend(extensions.snapshot(), trigger=(args.frequency, 'epoch'))
+ frequency = args.frequency if args.frequency is not -1 else args.epoch
+ trainer.extend(extensions.snapshot(), trigger=(frequency, 'epoch'))
# Write a log of evaluation statistics for each epoch
trainer.extend(extensions.LogReport())
