Closed xiaohu2015 closed 3 years ago
The first two hooks are used to calculate the AP on the coco validation set for student and teacher model. The hooks inside the "cfg.TEST.VAL_LOSS" condition are used to calculate the losses on the coco validation set (RPN classification/regression loss, BBox classification/regression loss).
Yes, it is what @vinkle said (thanks @vinkle!), while it is a hacky way to compute validation loss. It takes additional model inference to compute validation losses, so it is not that efficient.
You could set cfg.TEST.VAL_LOSS = False
to speed up the training if you do not need the validation loss.
I found that the trainer would do eval on student and teacher model for some
EVAL_PERIOD
:ret.append(hooks.EvalHook(cfg.TEST.EVAL_PERIOD, test_and_save_results_student)) ret.append(hooks.EvalHook(cfg.TEST.EVAL_PERIOD, test_and_save_results_teacher))
but why you add another eval hook: