question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convert mask rcnn to onnx failed. RuntimeError: ONNX export failed

See original GitHub issue

Hi, I was trying to convert a mask rcnn model (maskrcnn-benchmark) to onnx model. I encountered this error

RuntimeError: ONNX export failed: Couldn't export Python operator _NewEmptyTensorOp

I think that is some class defined here https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/maskrcnn_benchmark/layers/misc.py#L18 Anyone has any solutions?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20

github_iconTop GitHub Comments

1reaction
jinfagangcommented, Aug 14, 2019

You can try export fastercnn to onnx first, It would be much more easy.

0reactions
AidenFathercommented, Aug 12, 2022

The reason for this error is because the example image I used, my maskrcnn could not detect any masks so for some layers the input is of size 0. Using another image from the training set solves the problem. Now I can export to onnx.

@WonderAndMaps Can you please share your work in convert maskrcnn to onnx? Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

torch.onnx — PyTorch 1.13 documentation
When exporting a model that includes unsupported operators, you'll see an error message like: RuntimeError: ONNX export failed: Couldn't export operator foo.
Read more >
How to Convert a PyTorch Model to ONNX in 5 Minutes - Deci AI
In this article, we will walk you through how to convert an ONNX model to PyTorch, as well as some best practices that...
Read more >
Issue exporting detectron2 mask-rcnn to ONNX with batchNorm
Any suggestions on how can I resolve this error? or,. Any leads on how to export detectron2's maskrcnn to ONNX with the batch...
Read more >
Highest scored 'onnx' questions - Stack Overflow
Cannot export PyTorch model to ONNX. I am trying to convert a pre-trained torch model to ONNX, but recive the following error: RuntimeError:...
Read more >
Tutorial 8: Pytorch to ONNX (Experimental)
How to convert models from Pytorch to ONNX. Prerequisite ... The Parameters of Non-Maximum Suppression in ONNX Export. Reminders. FAQs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found