open-mmlab/mmengine

[Bug] Setting EpochBasedTrainLoop.val_begin=0 does not work!

Opened this issue · 0 comments

Prerequisite

Environment

mmengine == 0.9.0, but the related code in the latest version is the same.

Reproduces the problem - code sample

Set EpochBasedTrainLoop.val_begin to 0 and run it.

Reproduces the problem - command or script

Set EpochBasedTrainLoop.val_begin to 0 and run it.

Reproduces the problem - error message

The val_loop is still launched after the first epoch.

Additional information

I'm currently using EpochBasedTrainLoop to train my model. After I added a custom Metric, I want to test it before training. So I need to run val_loop before the first epoch. I set the val_begin to 0 but nothing happens.
I checked the code. Move self.run_epoch() line 96 to line 103 in loops.py should fix this bug.