hub icon indicating copy to clipboard operation
hub copied to clipboard

Saving best.pt

Open Aftondil opened this issue 11 months ago • 2 comments
trafficstars

Search before asking

  • [X] I have searched the HUB issues and found no similar feature requests.

Description

Hey there thanks for such great job, I wanted to ask if Hub could save best.pt also , while training in colab , we may run out of resources, and then best.pt is deleted automatically, if we resume it in the end we get error finding best.pt

Use case

No response

Additional

No response

Aftondil avatar Dec 19 '24 11:12 Aftondil

👋 Hello @Aftondil, thank you for raising an issue regarding Ultralytics HUB 🚀! Your suggestion about saving best.pt is appreciated, and we understand how this could help avoid issues when resuming training. An Ultralytics engineer will review your request soon.

Meanwhile, it would be great if you could share more details to help us address your concern effectively. For bugs or unexpected behavior, please provide a minimum reproducible example (MRE) or clearly outline the steps to reproduce the issue.

We aim to respond to all issues as promptly as possible. Thank you for your patience! 😊

UltralyticsAssistant avatar Dec 19 '24 11:12 UltralyticsAssistant

@Aftondil hello, thank you for your kind words! The credit truly goes to the entire YOLO community and the Ultralytics team for their hard work and dedication. 😊

Regarding your query, the issue you're describing often occurs when working in transient environments like Google Colab, where temporary storage is used, and files like best.pt can be lost after the session ends or resources are exhausted.

To address this, the Ultralytics HUB platform can be a fantastic solution. When training a model on Ultralytics HUB (whether via cloud training or by linking your local training), the system automatically uploads and stores the best.pt model and other training artifacts securely. This ensures that you won't lose any files, even if your local resources become unavailable. Additionally, with HUB, you can easily resume training without worrying about lost checkpoints.

If you're training in Colab and still prefer to save the best.pt locally, you could periodically download it to your local machine or upload it to cloud storage like Google Drive during training. Here's an example snippet to save best.pt to Google Drive:

from google.colab import drive
drive.mount('/content/drive')

# Save best.pt to Google Drive
!cp /path/to/your/best.pt /content/drive/MyDrive/

Alternatively, for a more streamlined approach, consider trying Ultralytics HUB Cloud Training. It eliminates the hassle of manual file handling and ensures that your training progress and artifacts are safe and accessible.

Let me know if you have further questions! 🚀

pderrenger avatar Dec 20 '24 05:12 pderrenger