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

Onnx conversion problem #141

Open
capslocknanda opened this issue May 15, 2024 · 1 comment
Open

Onnx conversion problem #141

capslocknanda opened this issue May 15, 2024 · 1 comment

Comments

@capslocknanda
Copy link

Hi thank you for sharing this repo.
I have successfully trained a model with fasterrcnn_squeezenet1_1_small_head.
But while converting the model to onnx, I get some error.
"torch.onnx.errors.SymbolicValueError: Unsupported: ONNX export of operator get_pool_ceil_padding, input size not accessible. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues [Caused by the value '219 defined in (%219 : Float(1, 64, *, *, strides=[10188864, 159201, 399, 1], requires_grad=1, device=cpu) = onnx::Relu(%input.7), scope: torchvision.models.detection.faster_rcnn.FasterRCNN::/torch.nn.modules.container.Sequential::backbone/torch.nn.modules.activation.ReLU::backbone.1 # /home/subhajit/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/nn/functional.py:1469:0
)' (type 'Tensor') in the TorchScript graph. The containing node has kind 'onnx::Relu'.]"
"Inputs:
#0: input.7 defined in (%input.7 : Float(1, 64, *, *, strides=[10188864, 159201, 399, 1], requires_grad=0, device=cpu) = onnx::Conv[dilations=[1, 1], group=1, kernel_shape=[3, 3], pads=[0, 0, 0, 0], strides=[2, 2]](%input.3, %backbone.0.weight, %backbone.0.bias), scope: torchvision.models.detection.faster_rcnn.FasterRCNN::/torch.nn.modules.container.Sequential::backbone/torch.nn.modules.conv.Conv2d::backbone.0 # /home/subhajit/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/nn/modules/conv.py:456:0
) (type 'Tensor')
Outputs:
#0: 219 defined in (%219 : Float(1, 64, *, *, strides=[10188864, 159201, 399, 1], requires_grad=1, device=cpu) = onnx::Relu(%input.7), scope: torchvision.models.detection.faster_rcnn.FasterRCNN::/torch.nn.modules.container.Sequential::backbone/torch.nn.modules.activation.ReLU::backbone.1 # /home/subhajit/miniconda3/envs/detectron/lib/python3.8/site-packages/torch/nn/functional.py:1469:0
) (type 'Tensor')"

If you have any idea how to tackle this that will be helpful.
thanks.
@sovit-123
Copy link
Owner

Hi. Can you please check that you have PyTorch version at least 1.12.1 and ONNX version 1.12.0?

I trained Faster RCNN ResNet FPN V2 with PyTorch 2.2.0 and was able to successfully covert with ONNX version 1.120. I have also update the requirements file with proper ONNX versions for conversion and GPU and CPU inference.

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