GithubHelp home page GithubHelp logo

Comments (3)

glenn-jocher avatar glenn-jocher commented on July 19, 2024

Hello! Thanks for reaching out with your query. 🌟

It's normal to observe a decrease in loss when you resume training from a checkpoint like last.pt. This behavior can occur due to several factors:

  1. Learning Rate Adjustments: If your training involves learning rate schedulers, resuming might adjust the learning rate, impacting the loss.
  2. Batch Normalization and Other States: Resuming training reloads the state of the model, including aspects like batch normalization, which might have been in a more optimized state at the checkpoint.

As long as your loss is decreasing and your validation metrics are improving, this behavior is generally positive. It indicates that the model is refining its ability to generalize from the training data.

If you have further details or specific concerns, feel free to share! Happy coding! 🚀

from ultralytics.

YEONCHEOL-HA avatar YEONCHEOL-HA commented on July 19, 2024

thanks for your answer.
This decrease only occurs for 1 or 2 epochs (immediately after resuming). and then loss function increase before resume. that's weird

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 19, 2024

Hello!

It's great to hear back from you. The behavior you're observing where the loss decreases for a couple of epochs right after resuming and then increases could be related to several factors:

  1. Optimizer State: When resuming, the optimizer state is also loaded from the checkpoint. This state might initially be very well-tuned to the data seen just before saving. As training progresses post-resumption, the optimizer needs a few epochs to readjust to the broader dataset characteristics.

  2. Data Shuffling: If the data shuffle pattern changes upon resumption, the model might initially benefit from this "new" data arrangement, reflecting as a temporary improvement in loss.

  3. Batch Normalization: The running averages used in batch normalization layers might cause slight fluctuations in loss as they adjust to the resumed training regime.

It's generally a good idea to monitor not just the loss but also other metrics like accuracy or validation performance to get a fuller picture of the model's behavior post-resumption.

If the issue persists or significantly impacts your model's performance, consider examining the learning rate schedules or the state of the optimizer when resuming.

Keep up the great work, and don't hesitate to reach out if you have more questions! 🌟

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.