[GH-ISSUE #688] [Feature Request] Save the last n checkpoint #413

Open
opened 2026-10-20 09:59:06 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @nikita488 on GitHub (Jul 4, 2023).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/688

While saving only the latest '.ckpt' file to save disk space is a great idea, there are several situations where something unexpected happens like some error in Colab that is corrupting latest D/G_2333333.pth file (not saving it fully), or saving only D while not having time to save G checkpoint (or vise versa) because it was interrupted.

I trained a few models using Colab and a lot of them had corrupted D or G checkpoint because some error happened while it was saving, so i lost hours of trained data and need to start from scratch which is very annoying.

My idea is to have some option inside UI like "Save last n checkpoints". As an example, if you set this option to 10 and the 'Save frequency (save_every_epoch)' set to 10, it will save 10, 20, 30 ... 100 epoch D and G checkpoints, then it will delete oldest checkpoints (D_10.pth and G_10.pth in this example), and save latest one (save 110, then delete 20 epoch checkpoints and save 120 and continue). That way we will have some backups and can continue to train model from a older checkpoint if something bad happened with latest checkpoint.

Originally created by @nikita488 on GitHub (Jul 4, 2023). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/688 While saving only the latest '.ckpt' file to save disk space is a great idea, there are several situations where something unexpected happens like some error in Colab that is corrupting latest D/G_2333333.pth file (not saving it fully), or saving only D while not having time to save G checkpoint (or vise versa) because it was interrupted. I trained a few models using Colab and a lot of them had corrupted D or G checkpoint because some error happened while it was saving, so i lost hours of trained data and need to start from scratch which is very annoying. My idea is to have some option inside UI like "Save last n checkpoints". As an example, if you set this option to 10 and the 'Save frequency (save_every_epoch)' set to 10, it will save 10, 20, 30 ... 100 epoch D and G checkpoints, then it will delete oldest checkpoints (D_10.pth and G_10.pth in this example), and save latest one (save 110, then delete 20 epoch checkpoints and save 120 and continue). That way we will have some backups and can continue to train model from a older checkpoint if something bad happened with latest checkpoint.
Author
Owner

@RVC-Boss commented on GitHub (Jul 5, 2023):

ok, in the next version I will modify it to save the latestest 2 ckpt.

<!-- gh-comment-id:1620950054 --> @RVC-Boss commented on GitHub (Jul 5, 2023): ok, in the next version I will modify it to save the latestest 2 ckpt.
Author
Owner

@nikita488 commented on GitHub (Jul 5, 2023):

Great!

<!-- gh-comment-id:1621167761 --> @nikita488 commented on GitHub (Jul 5, 2023): Great!
Author
Owner

@nikita488 commented on GitHub (Jul 5, 2023):

Renaming existing checkpoints to G/D_*.pth.bak and saving new ones probably will do

<!-- gh-comment-id:1621411757 --> @nikita488 commented on GitHub (Jul 5, 2023): Renaming existing checkpoints to G/D_*.pth.bak and saving new ones probably will do
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#413
No description provided.