-
Notifications
You must be signed in to change notification settings - Fork 681
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
Problems converting different networks. #200
Comments
Hi simoneluetto, Thanks for reaching out! Yes, it is likely the unsupported operations causing problems. Currently, it is possible that the conversion can produce false positive conversions, by adding constant layers. If all layers are supported this shouldn’t happen. I would like to consider how to make these failed conversions explicit, but for now it may be best to implement a converter for unsqueeze, or use a different operation. Please let me know if you have any questions. Best, |
But i should have solved adding the converter for operation unsqueeze, now during the conversion there are no unsupported operations detected, is probably that there are other unsupported operations not detected? Or what could be the cause of the errors? |
It's possible that an unsupported operation was not detected. Currently, it's not perfect how this is done (primarily looks for functions under For the SSD model in particular, there are likely operations related to anchor box parsing that are not supported. Typically though, object detection models contain a backbone CNN, which likely is supported. I haven't investigated the model you sent in particular, but it may look something like backbone_trt = torch2trt(model.backbone, [data]) # may vary, for illustrative purposes
model.backbone = backbone_trt Are you able to determine if this method matches your use case? Best, |
I get the error that unsqueeze is unsupported when I try to convert an inception_v3 model, but when I convert resnet models it works, even though I'm using unsqueeze in my transform in both cases. |
Here's what I get when I try to convert
It seems to me that someone must have successfully converted |
I figured out my issue. Torch's |
You can create your own wrapper for the torchvision models or any model that contains a dictionary output(OrderedDict etc). [Tested with
Usage :
Also to be able to re-create the model from the saved backbone you will need another wrapper to map these output tensors into a dictionary with corresponding tags(Probably there will an expectation in the main
Usage :
|
I succesfully tried the repo on some network in the examples, however i encountered some issues trying to convert different networks.
I use a jetson nano with Tensorrt 5.0.6 and torch 1.2.0
First i tried to convert Inceptionv3 from torchvision models, the network is not converted and the error is:
During conversion:
[TensorRT] ERROR: Unused Input: i
Then during inference:
AttributeError: 'NoneType' object has no attribute 'get_binding_index'
I also tried to convert an implementation of SSD-mobilenet-v2 that can be found at: "https://github.com/qfgaohao/pytorch-ssd"
this time the conversion script runs without any problem however the resulting network gives completely wrong score prediction, what could be the reason?
For both the cases there was the unsupported operation torch.unsqueeze that is a simple addition of a singleton dimension, if i understood it correctly, for this reason i used the same converter of function view to implement it.
The text was updated successfully, but these errors were encountered: