Skip to content

Commit

Permalink
Add validation loss computation as optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dshahrokhian committed Feb 27, 2019
1 parent e764b11 commit a4b5ecc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keras_retinanet/bin/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def csv_list(string):
parser.add_argument('--image-max-side', help='Rescale the image if the largest side is larger than max_side.', type=int, default=1333)
parser.add_argument('--config', help='Path to a configuration parameters .ini file.')
parser.add_argument('--weighted-average', help='Compute the mAP using the weighted average of precisions among classes.', action='store_true')
parser.add_argument('--compute-val-loss', help='Compute validation loss during training', dest='compute_val_loss', action='store_false')

# Fit generator arguments
parser.add_argument('--workers', help='Number of multiprocessing workers. To disable multiprocessing, set workers to 0', type=int, default=1)
Expand Down Expand Up @@ -492,6 +493,9 @@ def main(args=None):
else:
use_multiprocessing = False

if not args.compute_val_loss:
validation_generator = None

# start training
return training_model.fit_generator(
generator=train_generator,
Expand Down

0 comments on commit a4b5ecc

Please sign in to comment.