-
Notifications
You must be signed in to change notification settings - Fork 273
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
No output | Custom dataset | TensorRT #42
Comments
Hi, can you try |
Hi, No, the issue is not resolved yet. |
I suspect it is related to #38 and we are currently investigating on this issue (seems TensorRT related). Will let you know about the progress, and we might also need some information from you, thanks. |
Okay, thank you! I'll continue to debug in the meantime and will update here in case I see any progress. |
Thanks! |
Hi, Just an update! I figured that I get outputs for few of my test samples, provided that it passes the second You can replicate the issue by changing the |
Hi @haotian-liu, after much debugging I figured out that there's no issue with TensorRT! While using TRT, when I specify Now, I'm facing another issue where I get duplicate detections (both with TensorRT and I believe the issue is in this line below, After selecting the While, the shapes of Is my understanding and finding correct? I think if we fix this issue, we can permanently fix Issue #27 as well. |
Hi @smahesh2694, with TensorRT, the score might be different from the ones predicted by the pure PyTorch model, but it does not necessarily to be lower. All of our demo code and benchmarks are evaluated and generated with same hyperparameters for TensorRT (FP16/INT8) and PyTorch code. But for some reason, one some of the models trained on custom dataset, the TensorRT predictions will cause some issues (and there are quite weird and complicated phenomenon related to CUDA/TensorRT engine). For your second issue (for both TRT and PyTorch), I currently don't get as they should have same shape in the first dimension of N as they are filtered with same keep as here. Can you elaborate more? |
Thanks @haotian-liu! Yes, I agree with your first answer regarding TensorRT. For the second issue, the shape of my In my detect() function, Shape of conf_score is [X]
Shape of keep is [X]
Shape of cur_scores is [num_classes, X]
Shape of scores is [num_classes, n] where n = count_nonzero(keep)
Shape of boxes is [n, 4]
Shape of masks is [n, 32] Because of a mismatch in I also wanted to let you know that, I have currently found a quick fix for my case as I replace the line return {'box': boxes[:torch.count_nonzero(scores > self.conf_thresh)], 'mask': masks[:torch.count_nonzero(scores > self.conf_thresh)], 'class': classes[:torch.count_nonzero(scores > self.conf_thresh)], 'score': scores[:torch.count_nonzero(scores > self.conf_thresh)]} But, I would appreciate your comments here as I don't want this ugly fix forever! |
Hi @smahesh2694, I still don't see what is wrong with the shape you printed. why is the shape |
As per your previous comment, I thought the shape of scores should be |
@smahesh2694 scores before NMS should be [X, N] as it is required for computing NMS. |
Thanks for the help @haotian-liu! I'm closing the issue now! |
I somehow figured out that the cause and applied the fix, details of the solution are explained in #47. Please take a look to see if the issue can be resolved. |
Hi @haotian-liu,
I'm working on a custom instance segmentation task with three classes. While I get output segmentations on my Jetson Xavier by using tag
--disable_tensorrt
, there's no output when I run the model on TensorRT.I'm training a ResNet50 model on my PC and transferring the learned model to Jetson for inference.
Initially, I suspected the error is similar to issue:27 as I got IndexError Warnings when enabling TensorRT. But while debugging I found that
except
blocks do no harm.My commented
detection.py
file:Command that I use to run evaluation:
Please note: If I add
--disable_tensorrt
tag, I get results as the code executes intry
blocks.I also ensure to remove the cached '.trt' files in
./weights
folder.Can you help me here ? Thank you!
The text was updated successfully, but these errors were encountered: