Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(train): improve quality of training #274

Merged
merged 6 commits into from
Apr 9, 2023
Merged

Conversation

Lordmau5
Copy link
Collaborator

@Lordmau5 Lordmau5 commented Apr 9, 2023

This PR includes several things discussed in #270

  • It ensures the _temp_epoch variable is initialized in the LightningModule's __init__ method (thanks @ne0escape)
  • It moves the __init__ method of the LightningModule to the top (bit of cleanup)
  • It fixes the order of optimization done to the model as per the Lightning.AI documentation (lightning.ai/docs/pytorch/stable/common/optimization.html#id2)
  • It removes a with torch.no_grad(): call for the generator loss calculation which ends up vastly improving the quality of the model (less metallic noise during several tests with a model from scratch)
  • It fixes the log_audio_dict function so it use the correct total_batch_idx value
  • It fixes checkpoints saving twice (or multiple times) since validation_step is being run for every model apparently (we check if batch_idx is 0 and only then save)

Please tell me if you'd like to see any changes made before potentially merging this 🙏

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2023

Codecov Report

Merging #274 (61a09b2) into main (0979147) will not change coverage.
The diff coverage is 10.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #274   +/-   ##
=======================================
  Coverage   20.51%   20.51%           
=======================================
  Files          38       38           
  Lines        3247     3247           
  Branches      418      417    -1     
=======================================
  Hits          666      666           
  Misses       2564     2564           
  Partials       17       17           
Impacted Files Coverage Δ
src/so_vits_svc_fork/train.py 22.84% <5.26%> (ø)
src/so_vits_svc_fork/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Lordmau5
Copy link
Collaborator Author

Lordmau5 commented Apr 9, 2023

Two examples of the TF2 Spy after only 200 iterations with the fix:
original_1.webm
generated_1_200.webm

original_2.webm
generated_2_200.webm

@34j 34j merged commit 7ed71d6 into voicepaw:main Apr 9, 2023
@34j
Copy link
Collaborator

34j commented Apr 9, 2023

😍🥰😎

@Lordmau5 Lordmau5 deleted the fix/train branch April 10, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants