Closed V4A001 closed 1 year ago
This issue does not occur in Google Colab. It is windows and this .pt file related.
@V4A001 im also facing same, defult yolov5-cls.pt working but custom trained model not working
me too. I can predict.py in my local PC, only with a model trained locally. But got the same error, trying to predict locally, with best.pt or last.pt trained in Colab. The model trained in colab, predicts fine in colab.
š Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.
Access additional YOLOv5 š resources:
Access additional Ultralytics ā” resources:
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 YOLOv5 š and Vision AI ā!
Hey @danielsoy and @arreios, thanks for your reports. This issue might involve the way the file paths are handled in your local environment. You can try using the Path
from the pathlib
library to handle file paths in a platform-independent way. You can also check that the file paths you are using are correct and accessible. Let me know if you need further assistance. Remember, the YOLOv5 community is here to help each other out! š
yes i am with same error can anyone help with exact steps about how to do this
@Krushu24365 hello everyone, it seems like the issue might be related to the way file paths are handled across different operating systems. Here's a quick step you can try:
PosixPath
object, convert it to a string.For example, if you have:
weights_path = Path('best.pt')
Convert it to a string like this:
weights_path = str(Path('best.pt'))
Then use weights_path
as the argument for loading weights.
If you continue to encounter issues, please ensure that your environment is set up correctly and that the file paths are accessible. If the problem persists, providing the exact error message and the code snippet where the error occurs could help us diagnose the issue more effectively. š ļø
Search before asking
YOLOv5 Component
Detection
Bug
After training I wanted to use the last.pt and best.pt. But both throw this 'PosixPath' exception. I tried using the provided models and they do not throw any error. python segment/predict.py --weights best.pt --source testimage.jpg
segment/train.py --device 0 --img 640 --cfg yolov5s-seg.yaml --hyp data/hyps/hyp.scratch-high.yaml --batch 16 --epochs 100 --data my.yaml --weights yolov5s-seg.pt
I am now trying training with yolov5l-seg.yaml to see if this makes a difference. I had working version with https://github.com/WongKinYiu/yolov7, but was not able to create a proper ONNX file. So now doing the same with this library. Previously I used Google Colab, but I believe that does not make the difference.
Environment
Minimal Reproducible Example
I used segment/train.py --device 0 --img 640 --cfg yolov5s-seg.yaml --hyp data/hyps/hyp.scratch-high.yaml --batch 16 --epochs 100 --data my.yaml --weights yolov5s-seg.pt
Additional
No response
Are you willing to submit a PR?