How to save the loss value for each step during the training process?

#91
by zhouwen999 - opened

I am training Whisper using my own dataset, and although the console will print loss values during the training process, I don't know how to save these loss values in a specified list. How should I operate it? Thank you very much!!!

Hey @zhouwen999 - you can adjust the logging_steps to control how frequently the values are printed. You can also chose which platforms you log to with the report_to argument. The Trainer will log the loss in the specified format types according to the arguments here.

If you want the log history in any other format, you can find them in Seq2SeqTrainer.state.log_history. There is a parse_log_history function in the model-card module that might be helpful to clean those logs.

trainer = Seq2SeqTrainer(...)

trainer.train()
log_history = trainer.state.log_history

Thank you very much! I have solved the above problem according to your answer. Thank you again for your help.

Sign up or log in to comment