resume_training false with weights set loads weights but resets optimizer/scheduler, strict_weights_loading argument#384
Conversation
…izer/scheduler, strict_weights_loading argument
…s True, tests with modified checkpoint files uploaded to GCP
|
Warning Review limit reached
More reviews will be available in 1 minute and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Purpose
strict_weights_loadingthat fails immediately if any part of the model state dict is different.resume_trainingis set to False and weights are passed, then the weights are still loaded but the optimizer/scheduler states are taken from the config. Previously this combination ofresume_trainingand weights being passed would create a fresh model instead of loading the weights.resume_trainingis set to True, then the behavior is unchanged (from Fix: resume_training and passing weights should function correctly #326)Weights provided on the command line, but config weights are set. " "Ignoring weights provided in config or during LuxonisModel initializationeven if the config weights were not set, this has been patched. I had to addself._weights_provided_during_initandself._weights_provided_in_configattributes because one level lower (inresolve_weights) it has no indication of which weights came from the config or the CLI.Specification
Dependencies & Potential Impact
Deployment Plan
Testing & Validation
repvgg_encoder.scale_layer.conv.weight.__unexpected__crashed quickly ontrainandinferifstrict_weights_loadingis set to True:strict_weights_loadingis set to False (default), training and inference continue even with mis-matching state dicts:resume_trainingset to False and weights are passed: starts from epoch 0 again with only the checkpoint loaded but not the surrounding (optimizer/scheduler/epoch count etc) state.AI Usage
Submitted code was reviewed by a human: YES
The author is taking the responsibility for the contribution: YES