Skip to content
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

vx-delegate and Yolov5 models #189

Open
burtbick opened this issue Jun 17, 2023 · 8 comments
Open

vx-delegate and Yolov5 models #189

burtbick opened this issue Jun 17, 2023 · 8 comments

Comments

@burtbick
Copy link

Sorry if this is a duplicate. I had asked on the tim-vx github a few days ago.

We've been trying to get Yolov5 models working with the NXP imx8mp with the NPU. The models we have tested all work just fine with the CPU, and the same tflite models compiled for the Google TPU also work just fine.

The models are object detection. First started with our model exported per the NXP docs. When that didn't work we got the NXP Yolov5 demo model and script from NXP support. But that also fails in the same way.

Finally another NXP user who says he has it working with the same NXP BSP and TFlite versions provided his model. But that model also fails in the same way for us.

Using the recommended .71 NXP BSP and TFlite 2.9.1. With the NPU the models give all zeros for bounding box output, and I suspect the confidence score may be bogus as well.

Has anyone else seen this type of issue when processing Yolov5 models using the NPU? And if so how did you resolve it?

I see a custom op for yolo4 lite, but don't see the build configuration setting up to include that processing. Since that custom op appears to deal with yolo4 post processing I'm wondering if that might also apply for yolo5 models. Is there some Yocto build option that needs to be set to properly process yolov5 models with the vx-delegate and NPU?

Thanks,

@sunshinemyson
Copy link
Contributor

@burtbick ,

I can forward your problem to NXP team. Would you mind share your model?

Thanks

@burtbick
Copy link
Author

burtbick commented Jun 19, 2023 via email

@robert-kalmar
Copy link
Contributor

Hi @burtbick ,
I am sorry NXP support does not provided an acceptable solution for you.

Can you please share the NXP community link in order match these issues and provide the help?

Best Regards
Robert

@burtbick
Copy link
Author

burtbick commented Jun 20, 2023 via email

@burtbick
Copy link
Author

burtbick commented Jul 2, 2023

Just reporting back that the patch I received from NXP appears to have resolved the problem we were having.
This was a patch to the vx-delegate op_map.cc source file and was a fairly significant patch. Not sure why they didn't have that already included in their Yocto build or notes, but at least it is fixed now.

@gagolucasm
Copy link

Great! Can you share the patch? We are running into a similar issue. Thanks!

@burtbick
Copy link
Author

burtbick commented Jul 4, 2023

Here's a link to the patch file. The file as received is diff.patch and needs to be applied to the op_map.cc vx-delegate file.

Of course be sure to verify that the patch applies properly, and this is for TFLIte version 2.9.1 which is what we have, and it applied and resolved the issue with no problems.
Here's the patch file..

diff.patch.tar.gz

@gkinman
Copy link

gkinman commented Aug 27, 2024

Here's a link to the patch file. The file as received is diff.patch and needs to be applied to the op_map.cc vx-delegate file.

Of course be sure to verify that the patch applies properly, and this is for TFLIte version 2.9.1 which is what we have, and it applied and resolved the issue with no problems. Here's the patch file..

diff.patch.tar.gz

I'm running into what appears to be the exact same issue as you, except with YOLOv8. Did you have to rebuild the vx-delegate from source? If so, how? I'm having difficulty with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants