Report errors while continuing training
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.
Additional
No response
👋 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
-
Resume Training: When you resume training using
--resume, YOLOv5 expects to find thelast.ptcheckpoint from the specified folder. If you want to specify a different path for the weights, you need to ensure thelast.ptis correctly located in your desired directory. -
Configuration Path: Verify that your command explicitly mentions the correct path to the
last.ptfile. If you're using a different directory structure, you might need to update the path in your command line. -
Command Example:
python train.py --resume path/to/your/desired/folder/last.pt -
Directory Check: Ensure there are no conflicts or other
last.ptfiles 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.ptfile is indeed in the directory you intend to resume from. - Run the command with explicit paths to avoid default behaviors.
Resources
- For detailed guidance on training, check our Custom Data Training tutorial.
- Ensure all your requirements.txt are up to date.
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!
@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.
👋 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 ⭐