-
Notifications
You must be signed in to change notification settings - Fork 550
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
Questions regarding changes to yolo plugin #416
Comments
Yes. I would add 2 or 3 (or more) yolo plugins into the network depending on how many output conv layers there are. The code is here: tensorrt_demos/yolo/plugins.py Lines 82 to 83 in af87896
I don't set an upper limit on output bbox count. All detection boxes with "scores" higher than the threshold would be kept. They would go through NMS before the final detection results are generated. The relevant code is here: tensorrt_demos/utils/yolo_with_plugins.py Lines 100 to 101 in af87896
Yes, I pass the particular information to the plugin as 1 single value instead of 2. This is to avoid a problem as described here: NVIDIA/TensorRT#238. TensorRT plugin code seems to handle
Lower-end Jetson SoCs, such as TX2 and Nano, have only 256 GPU cores in total. I don't want the yolo plugin to occupy all GPU cores in such systems (i.e. trying to keep some GPU cores available for processing other TensorRT OPs/kernels in parallel). However, based on my own tests, it doesn't seem to make much difference (between 64 and 256). |
Thanks for the answers, they make perfect sense. |
Hi @jkjung-avt |
For "yolov4-tiny" and "yolov4" models, the conv layers proceeding yolo layers are with "linear" activation, e.g. yolov4.cfg
In this case, my yolo plugin would calculate "sigmoid" on the input values. Refer to code here: tensorrt_demos/plugins/yolo_layer.cu Lines 230 to 231 in 58ad1e9
In contrast, "yolov4-csp" and "yolov4x-mish" models would have those conv layers with "logistic" activation, e.g. yolov4x-mish.cfg
So in this latter case, I don't need to calculate "sigmoid" in the plugin code: tensorrt_demos/plugins/yolo_layer.cu Line 288 in 58ad1e9
In case you are interested in reading the code which handles different types of conv activations, check here: tensorrt_demos/yolo/yolo_to_onnx.py Line 699 in 58ad1e9
|
Yes I only now realised that sigmoid and logistic are practically the same thing. I'm using the TensorRT Layer API (as in tensorrtx) but for converting weights I have to use the python ScaledYolov4 Repo. And there seem to be minor differences in the cfg files of the Python Implementation and Darknet (and consequently in the weights) which is VERY annoying. Starting with this: And also this: And furthermore this (route layer versus route_lhalf): I guess I'll have to check all implementations for differences... |
I'm currently trying to implement yolov4-tiny from here: https://github.com/tjuskyzhang/Scaled-YOLOv4-TensorRT/tree/master/yolov4-tiny-tensorrt But using your plugin. With little success. |
I believe I need to add a Sigmoid Activation function and use new_coords. I will check that out. Thanks for the help jkjung. |
Nevermind.... yolov4-tiny does not use anchor 0.... That fixed it... |
Hi, I'm trying to update the yolo plugin in https://github.com/isarsoft/yolov4-triton-tensorrt to a more recent version with your fixes to batchsize and updates to compatiblity etc.
Could you briefly explain a few changes that you made to the plugin in comparison to the original from tensorrtx?
MAX_OUTPUT_BBOX_COUNT
how did you handle this change regarding output size etc?input_multiplier
for? I foundinput_multiplier = w // yolo_whs[i][0]
. So this is just to not passinput_width
andinput_height
? It could be calculated if the plugin knew those values?int mThreadCount = 256;
toint mThreadCount = 64;
, is there a performance reason for this?Thanks already for all those great fixes to the plugin, really helpful.
Could you very briefly explain other changes that you made to the plugin that you think would be significant enough to mention?
The text was updated successfully, but these errors were encountered: