yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

Report errors while continuing training

Open pjh11214 opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I have searched the YOLOv5 issues and discussions and found no similar questions.

Question

When I run train.py for target detection, my resume is set to True and I want to continue my previous training. However, when I have last.pt in my tarin-seg folder, I will read the tarin-seg file directly, instead of reading the weight under the tarin file that my target detects. I don't quite understand this question, please answer it for me. Is that my problem. 12345

Additional

No response

pjh11214 avatar Sep 14 '24 09:09 pjh11214

👋 Hello @pjh11214, and thank you for your interest in YOLOv5 🚀! This is an automated response, and an Ultralytics engineer will also assist soon.

Understanding the Issue

It seems you're encountering an issue with resuming training when using the --resume flag in YOLOv5, which might be reading weights from an unexpected location. Let's break this down:

Explanation

  1. Resume Training: When you resume training using --resume, YOLOv5 expects to find the last.pt checkpoint from the specified folder. If you want to specify a different path for the weights, you need to ensure the last.pt is correctly located in your desired directory.

  2. Configuration Path: Verify that your command explicitly mentions the correct path to the last.pt file. If you're using a different directory structure, you might need to update the path in your command line.

  3. Command Example:

    python train.py --resume path/to/your/desired/folder/last.pt
    
  4. Directory Check: Ensure there are no conflicts or other last.pt files in unintended directories that might be picked up by YOLOv5. It reads from the specified directory, but if unspecified, defaults may cause confusion.

Recommended Steps

  • Double-check the file paths and ensure clarity in your folder structure.
  • Confirm the last.pt file is indeed in the directory you intend to resume from.
  • Run the command with explicit paths to avoid default behaviors.

Resources

Additional Support

Feel free to post any logs or additional information that could help in diagnosing the issue further. Also, check out the related discussions or issues for more insights.

😃 Happy training, and thank you for using YOLOv5!

UltralyticsAssistant avatar Sep 14 '24 09:09 UltralyticsAssistant

@pjh11214 it seems like the resume option is loading weights from the train-seg folder instead of your intended train folder. Ensure that the --weights argument in your command points to the correct path of your desired checkpoint file, such as train/last.pt. If the issue persists, try specifying the exact path to the weights file you want to resume from.

pderrenger avatar Nov 09 '24 02:11 pderrenger

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

  • Docs: https://docs.ultralytics.com
  • HUB: https://hub.ultralytics.com
  • Community: https://community.ultralytics.com

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

github-actions[bot] avatar Oct 11 '25 00:10 github-actions[bot]