-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cuda bindings mismatch error using custom trained model #32
Comments
Hi @immaixq I am also trying to use a custom yolov8 model, but failed to do so. I also converted the
|
I suspect that the issue is in the hardcoded number of classes
If your custom model has different number of classes then it will break here
I suggest that you visualize your ONNX model using netron, and note the input/output names and the input/output dimensions. |
Hi @immaixq, The problem you posted seems to originate from a parameter mismatch. We have parameters called The input/output binding names should be noted from the ONNX model as @mzahana said. The input tensor names can be kept the same. The output tensor name I believe should be It also appears that your model outputs a 3 tensors, instead of 2 as we expect. Having additional information about your network would likely be useful. |
Hi @mzahana, To respond to your issue separately, hopefully my first response is helpful for your first issue. You're also right that the number of classes expected by the decoder node is hard coded, which will be problematic later. Currently, the issue seems to originate from the TensorRT node, and not the decoder. |
@kajananchinniahNV thanks for your response. My problem was solved after I changed the hard-coded number of classes according to my custom model. I suggest to make it a parameter. Thanks. |
Thanks for finding a fix to the issue! I'll remove the We'll be working on a patch to this issue soon. The solution you recommend sounds reasonable to me. @immaixq could you confirm that this also solves it for you? |
@kajananchinniahNV thank you. Actually, to make the fix more complete, the output dimension of the model could be a parameter. This way, the decoder can adapt to custom models with output tensor dimensions(not only the number of classes) that is different from the default one by Yolov8 [1, 84, 8400]. Thanks. |
@mzahana Thank you for your help and advice, I have gained some insights after looking into netron again. I did changed the number of classes in the script and I think the error is caused by the number of outputs my model gives, which consists of output0 and output1. I managed to fix the mismatch error after changing @kajananchinniahNV Thank you for your help, I have changed the parameters as mentioned above and managed to fix the mismatch error. Unfortunately another error occurred. The process has died without additional log on its cause. it'd be great if you could share some insights or advice on how to troubleshoot the cause of it. Really appreciate both of your help, thank you! |
I'll be reopening this until we have a solution merged in the repository for tracking purposes. We'll close it once a fix is in place. |
Hi @TeamRoboTo, I believe the issue is because the In the quickstart, the command we provide is:
The |
Yep, thanks you. Now it works :) |
Sorry,I have the same issue.I changed the code cloned from git(num_classes), and then I found that running ros2 launch according to quickstart didn't seem to compile my code, so my changes won't take effect,I want to know the correct operation,any suggestions? |
Hi @magic-Alex In our latest release because of our usage of debians now, it's harder to update the source code directly to apply this fix now. My recommendation for now would be to uninstall the debians for this package and instead compile the code from source (via If you run into issues doing this, please let us know! |
@kajananchinniahNV Thanks,it works! |
Hi @eddieliao , Could you please provide the full error trace? There can be many different reasons that the process dies. |
I've managed to get it to work with an image, but if I input a video it will crash when the video ends.
Here's the full output, although it doesn't seem too useful?
|
I have a similar issue with running a YOLOv8 module on Orin (Isaac ROS Object Detection), which worked with the quickstart tutorial. I am getting
The codebase:
Thanks for any help in advance! |
Description:
Encounter error using yolov8_tensor_rt.launch.py and isaac_ros_yolov8_visualize.launch.py. The scripts are run on jetson orin nano. The custom trained model is exported to onnx as suggested by documentation using ultralytics, I have also tried exporting using trtexec but still face the same error.
Thank you for your help.
The text was updated successfully, but these errors were encountered: