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

How to prevent tensorrt from fusing the final layers when trying to convert tiny yolov3 to int8? #601

Open
NIKHILDUGAR opened this issue Apr 25, 2023 · 2 comments

Comments

@NIKHILDUGAR
Copy link

I used the example given in https://github.com/jkjung-avt/tensorrt_demos#demo-5-yolov4 to convert my tiny yolov3 to int8 but the issue is that when I use --verbose on onnx_to_tensorrt.py step I see that the final layers are being fused.
How do I stop this from happening?

Thanks

@jkjung-avt
Copy link
Owner

In general, you could do mark_output() on a specific layer to prevent TensorRT from fusing it with other layers. Reference: NVIDIA/TensorRT#252 (comment)

Otherwise, please be more specific about which layers in your tiny yolov3 model you're having the trouble.

@NIKHILDUGAR
Copy link
Author

NIKHILDUGAR commented Apr 26, 2023

Hey, thanks for the quick response. I did look at the reference you provided and the problem I am having with it is that it doesn't really take layer names only tensors and the method I have seen mostly used by people is:-

last_layer = network.get_layer(network.num_layers -1) network.mark_output(last_layer.get_output(0))
Now since the output layers of tiny yolo ( in my case) or yolo are on different levels I can't correctly identify which layers to mark and how to do so correctly.

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

2 participants