yolov5/ #8575
Replies: 14 comments 21 replies
-
I have trained yolov5 on custom dataset and gave that code and best.pt to backend team in the first phase its working but after one month i have tuned the model and send that best.pt from that ppoint after chnaging best.pt we are getting an error (torch) ubuntu@ip-172-31-19-90:~$ python3 torch_yolo/app.py in my windows machine it is working fine but it is causing an issue there |
Beta Was this translation helpful? Give feedback.
-
Thankyou for your valuable suggestion the is resolved.
Thanks for the support
…On Fri, 1 Mar 2024, 22:45 Glenn Jocher, ***@***.***> wrote:
Hey there! 👋 It looks like you're encountering an issue with the NotImplementedError:
cannot instantiate 'WindowsPath' on your system error when trying to load
your model on an Ubuntu system, despite it working fine on Windows.
This error typically occurs due to path differences between Windows and
Unix-like systems (like Ubuntu). The model path is being interpreted as a
Windows path (WindowsPath) which isn't compatible with Unix-like systems.
A quick fix you might try is ensuring the path is correctly formatted as a
string when loading your model. For example:
# Instead of directly using the path object, convert it to a stringmodel_weights = str("/home/ubuntu/ModelWeights/SM/best.pt")predictor = YOLOv5Detector(model_weights)
This ensures Python treats the path as a string rather than a Path
object, which should be system-agnostic.
Also, make sure that when you're transferring the .pt file between
Windows and Ubuntu, the path doesn't get formatted into a Windows-specific
format. It's a good practice to define paths as raw strings or use forward
slashes (/) and avoid backslashes (\) which are typical in Windows paths.
If you've already tried cloning the latest YOLOv5 repo and the issue
persists, this path formatting might be the culprit. Give this a shot and
let us know how it goes! 🚀
—
Reply to this email directly, view it on GitHub
<#8575 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A47P4MFHSMQAHPZHRE6Q76LYWCZTLAVCNFSM6AAAAABEBTN5EWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMNBVHAZTE>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Athe issue is resolved
…On Fri, 1 Mar 2024, 22:45 Glenn Jocher, ***@***.***> wrote:
Hey there! 👋 It looks like you're encountering an issue with the NotImplementedError:
cannot instantiate 'WindowsPath' on your system error when trying to load
your model on an Ubuntu system, despite it working fine on Windows.
This error typically occurs due to path differences between Windows and
Unix-like systems (like Ubuntu). The model path is being interpreted as a
Windows path (WindowsPath) which isn't compatible with Unix-like systems.
A quick fix you might try is ensuring the path is correctly formatted as a
string when loading your model. For example:
# Instead of directly using the path object, convert it to a stringmodel_weights = str("/home/ubuntu/ModelWeights/SM/best.pt")predictor = YOLOv5Detector(model_weights)
This ensures Python treats the path as a string rather than a Path
object, which should be system-agnostic.
Also, make sure that when you're transferring the .pt file between
Windows and Ubuntu, the path doesn't get formatted into a Windows-specific
format. It's a good practice to define paths as raw strings or use forward
slashes (/) and avoid backslashes (\) which are typical in Windows paths.
If you've already tried cloning the latest YOLOv5 repo and the issue
persists, this path formatting might be the culprit. Give this a shot and
let us know how it goes! 🚀
—
Reply to this email directly, view it on GitHub
<#8575 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A47P4MFHSMQAHPZHRE6Q76LYWCZTLAVCNFSM6AAAAABEBTN5EWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMNBVHAZTE>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
how i can use my trained weights "best.pt". using opencv |
Beta Was this translation helpful? Give feedback.
-
Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
Yes,I do it. I have converted from json format with Polygon labels to YOLOv7 instance segmentation. The solution to this problem is to use hyp.scratch-high.yaml but set mixup to 0.0
天空
***@***.***
…------------------ 原始邮件 ------------------
发件人: "Glenn ***@***.***>;
发送时间: 2024年4月18日(星期四) 上午6:56
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [ultralytics/ultralytics] yolov5/ (Discussion #8575)
Hi there 👋! It seems like you're encountering an issue with dimension mismatch during the mixup augmentation process in YOLOv9's instance segmentation. This error typically occurs when the arrays you're trying to concatenate don't have the same shape — in this case, a discrepancy between the number of dimensions.
Without seeing the exact code or data structure you're working with, it's a bit difficult to provide a precise solution. However, one common approach is to ensure that both arrays being concatenated (segments and segments2) have the same dimensionality before performing the operation. For instance, if segments is a 1D array and segments2 is 3D, you might need to reshape or pad segments to match the dimensionality of segments2.
Here's a rough example of how to ensure they have the same number of dimensions:
import numpy as np # Assuming segments is 1D and segments2 is 3D # Reshape or pad segments to make its dimensions compatible with segments2 segments = np.expand_dims(segments, axis=(1, 2)) # Adjust this based on your specific shapes # Now that both have the same number of dimensions, concatenate should work segments_combined = np.concatenate((segments, segments2), 0)
Remember, the key here is to adjust the dimensions so they're compatible. The exact method (expand_dims, reshape, pad, etc.) will depend on your data.
If you continue to face issues, could you provide more details or a snippet of the code where this error occurs? That way, we can offer more targeted advice. Happy coding! 🚀
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is there any tutorials on utilizing an object tracker such as deepsort or sort with an older model like yolov5? Everytime I attempt to use a github I have found something breaks |
Beta Was this translation helpful? Give feedback.
-
Trying it in an nvidia jetson nano with jetpack 4.6 installed and getting AttributeError: partially initialized module 'cv2' has no attribute '_registerMatType' (most likely due to a circular import) |
Beta Was this translation helpful? Give feedback.
-
hello please i trained the yolov5 in my custom dataset that contains two classes but when i do the test the two classes show up with very close colors ( red and pink ) i want to the change the color of the boxes of detection? how please ? |
Beta Was this translation helpful? Give feedback.
-
Why i am not able to open webcam import cv2 my best.pt is in content foldermodel = torch.hub.load('ultralytics/yolov5', 'custom', path='/content/best.pt', force_reload=True) cap =cv2.VideoCapture(2) results=model(frame) cv2.imshow("YOLO", np.squeeze(results.render())) even if i enter below code , webcam doesn't open if cv2.waitKey(10) & 0xFF == ord('q'): cap.release() |
Beta Was this translation helpful? Give feedback.
-
i have a problem like this : |
Beta Was this translation helpful? Give feedback.
-
Does YOLO v5 support multi label classification? If yes, where can I find some examples and documentation? |
Beta Was this translation helpful? Give feedback.
-
Hello i am new to this but her i go, Note:
|
Beta Was this translation helpful? Give feedback.
-
Hello, I wanted to calculate the accuracy of the YOLOv5. I'm doing a physical testing. Can you recommend me, what is the formula that can I used for this physical testing? Is the formula will be like this? |
Beta Was this translation helpful? Give feedback.
-
yolov5/
Deep dive into Ultralytics' YOLOv5. Learn about object detection model - YOLOv5, how to train it on custom data, multi-GPU training and more.
https://docs.ultralytics.com/yolov5/
Beta Was this translation helpful? Give feedback.
All reactions