fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

RuntimeWarning: Early stopping conditioned on metric `mAP` which is not available #1366

Closed DmitryRyumin closed 4 years ago

DmitryRyumin commented 4 years ago

Hello everyone! Why am I receiving this warning?

RuntimeWarning: Early stopping conditioned on metric mAP which is not available. Available metrics are: loss,regression_loss,classification_loss,lr (self.monitor, ','.join(list(logs.keys()))), RuntimeWarning

hgaiser commented 4 years ago

Did you change something? I don't believe we configure early stopping on mAP.

DmitryRyumin commented 4 years ago

No! I didn't change anything. Latest Versions TF and Keras. Can I link to this metric?

ppizarror commented 4 years ago

Hi, mAP metric is added by Evaluation class in keras_retinanet.utils. Evaluation needs a validation_generator for computing the metric, so you need to define:

  1. Enable evaluation on your model
  2. Provide a validation dataset

From train.py:

    if args.evaluation and validation_generator:
        if args.dataset_type == 'coco':
            from ..callbacks.coco import CocoEval

            # use prediction model for evaluation
            evaluation = CocoEval(validation_generator, tensorboard=tensorboard_callback)
        else:
            evaluation = Evaluate(validation_generator, tensorboard=tensorboard_callback,
                                  weighted_average=args.weighted_average) <--- check this
        evaluation = RedirectModel(evaluation, prediction_model)
        callbacks.append(evaluation)
stale[bot] commented 4 years ago

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.