Hi. I have an evaluation decorated function like:
@trainer.on(Events.EPOCH_COMPLETED(every=cfg.train.validation_interval))
def run_validation():
epoch = trainer.state.epoch
state = evaluator.run(val_dataloader)
log_metrics(
logger, state.times["COMPLETED"], "Validation", state.metrics, epoch
)
Inside the evaluator
I do some text generations and would like to save them to new files named after the current epoch. However, I do not know how to get the current epoch inside this process function (engine.state.epoch always returns 1).
How can I get the current epoch inside the evaluation engine? Thanks in advance for any help you can provide.