Questions tagged [onnx]

ONNX is an open format to represent deep learning models and enable interoperability between different frameworks.

ONNX

The Open Neural Network Exchange (ONNX) is an open-source artificial intelligence ecosystem. With ONNX, AI developers can more easily move models between state-of-the-art tools and choose the combination that is best for them. ONNX is widely supported and can be found in many frameworks, tools, and hardware. It is developed and supported by a community of partners.

Official resources

809 questions
6
votes
4 answers

onnx graph, how to get output dimensions?

How to get dimensions of output layers in onnx neural net? I can get onnx graph, but there is no output dimensions: ~/onnx-tensorrt/third_party/onnx/onnx/tools/net_drawer.py --input ./weights/tiny_3l_v5_11_608.onnx --output…
Markus Kaukonen
  • 334
  • 4
  • 10
6
votes
2 answers

Can't get input column name of ONNX model to work

I am using ML.NET to import an ONNX model to do object detection. For the record, I exported the model from the CustomVision.ai site from Microsoft. I inspected the model file in Netron and it clearly shows the input node as being named "data" and…
Michael Bedford
  • 1,742
  • 20
  • 48
6
votes
1 answer

Error while converting pytorch model to core-ml

C = torch.cat((A,B),1) shape of tensors: A is (1, 128, 128, 256) B is (1, 1, 128, 256) Expected C value is (1, 129, 128, 256) This code is working on pytorch, but while converting to core-ml it gives me below error: "Error while converting op of…
xfarxod
  • 123
  • 2
  • 6
5
votes
2 answers

converting onnx model to tensorflow fails

I am trying to convert detr model to tensor flow using onnx. I converted the model using torch.onnx.export with opset_version=12.(which produces a detr.onnx file) Then I tried to convert the onnx file to tensorflow model using this example. I added…
kingGarfield
  • 304
  • 1
  • 12
5
votes
0 answers

Is possible to make bounding boxe inference from a detectron2 model in ONNX format?

After successful converting my model detectron2 model to ONNX format I cant make predictions. I am getting the following error: failed: Fatal error: AliasWithName is not a registered function/op My code: import onnx import onnxruntime as…
Vitor Bento
  • 384
  • 4
  • 17
5
votes
1 answer

Getting a prediction from an ONNX model in python

I can't find anyone who explains to a layman how to load an onnx model into a python script, then use that model to make a prediction when fed an image. All I could find were these lines of code: sess =…
Grant Allan
  • 189
  • 1
  • 4
  • 10
5
votes
2 answers

onnxruntime inference is way slower than pytorch on GPU

I was comparing the inference times for an input using pytorch and onnxruntime and I find that onnxruntime is actually slower on GPU while being significantly faster on CPU I was tryng this on Windows 10. ONNX Runtime installed from source - ONNX…
sn710
  • 581
  • 5
  • 20
5
votes
2 answers

Pytorch unable to export trained model as ONNX

I have been training a model in the Pytorch framework using multiple convolutional layers (3x3, stride 1, padding same). The model performs well and I want to use it in Matlab for inference. For that, the ONNX format for NN exchange between…
5
votes
1 answer

How do I convert a Detectron2 model into another deeplearning framework?

I would like to convert a detectron2 model into a another deeplearning framework i.e. PyTorch, TensorFlow or ONNX. How do I do this conversion? I can run inference on the detectron2 model with the cfg (which I believe means config in detectron2…
KamKam
  • 103
  • 1
  • 8
5
votes
1 answer

Loading or building cuda engine crashes occassionaly after upgrading to TensorRT 7

I'm trying to run TensorRT inference in C++. Sometimes the code crashes when trying to build a new engine or load the engine from the file. It happens occasionally (sometimes it runs without any problem). I follow the below steps to prepare…
Mahsa
  • 466
  • 2
  • 7
  • 26
5
votes
2 answers

Cannot export PyTorch model to ONNX

I am trying to convert a pre-trained torch model to ONNX, but recive the following error: RuntimeError: step!=1 is currently not supported I'm trying this on a pre-trained colorization model: https://github.com/richzhang/colorization Here is the…
Darkoob
  • 53
  • 1
  • 5
5
votes
0 answers

How to convert pytorch (CNN+LSTM) model to tflite?

I am trying to convert CNN+LSTM model mentioned in the following blog Image Captioning using Deep Learning (CNN and LSTM). Related github repo is : Pytorch image captioning I want to convert this pytorch model to tflite. It has both encoder and…
ML_AI
  • 51
  • 2
5
votes
1 answer

How to know input/output layer names and sizes for Pytorch model?

I have Pytorch model.pth using Detectron2's COCO Object Detection Baselines pretrained model R50-FPN. I am trying to convert the .pth model to onnx. My code is as follows. import io import numpy as np from torch import nn import…
batuman
  • 7,066
  • 26
  • 107
  • 229
5
votes
0 answers

ScatterND Plugin not found while converting onnx into tensorrt model

Able to convert pytorch model into onnx and validated onnx output with pytorch. it's working fine. But when I try to convert onnx into tensorrt engine, it fails at onnx parser and return this error. [TensorRT] ERROR: INVALID_ARGUMENT:…
sp_713
  • 51
  • 3
5
votes
0 answers

pytorch model -> onnx -> tensorflow

I made pytorch model for machine learning and I want to convert this to tensorflow model. I think I converted pytorch model to onnx. so now I want to convert onnx to tensorflow(pb) model. Here is my code. import onnx from onnx_tf.backend import…
sara
  • 49
  • 6
1
2
3
53 54