Warning occured when trying to load checkpoint to continue training

When I tried to load the trainer from a specific checkpoint (which were generated during a previous training process)

trainer.train("checkpoint-100")

The model did continue to train from the given checkpoint, but also I encountered this warning:

UserWarning: Please also save or load the state of the optimzer when saving or loading the scheduler.

warnings.warn(SAVE_STATE_WARNING, UserWarning)

Inside the “checkpoint-100” directory, there are 5 files: config.json, optimizer.pt, pytorch_model.bin, scheduler.pt, training_args.bin

Update:
The model loss reset (to higher value) after loading the checkpoint with the warning

HI, I’m facing a similar issue. How did you solve it?

It appeared to be some bug in my code. Did manage to fix it but now I don’t remember how

Vào 09:23, T.5, 17 Th9, 2020 Alex via Hugging Face Forums <hellohellohello@discoursemail.com> đã viết: