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
2
votes
0 answers

Use a model trained by Google Cloud Vertex AI accelerated with TRT on Jetson Nano

I am trying to standardize our deployment workflow for machine vision systems. So we were thinking of the following workflow. Deployment workflow So, we want to create the prototype for the same, so we followed the workflow. So, there is no problem…
2
votes
0 answers

Inference result not the same for ONNX model as for keras model

I've converted a model from Keras to Onnx with the following code: import tensorflow as tf import onnx import tf2onnx.convert from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.preprocessing import image model =…
Tekame1
  • 153
  • 4
2
votes
2 answers

The ML.net prediction has HUGE different compared with Custom Vision

I've trained a model(object detection) using Azure Custom Vision, and export the model as ONNX, then import the model to my WPF(.net core) project. I use ML.net to get prediction from my model, And I found the result has HUGE different compared with…
2
votes
0 answers

Calculate bounding boxes of YOLO in ONNX

I starting to use the ONNX ecosystem to convert the YOLO model from this repo. I have succesfully converted and excecuted the model in the ONNX runtime, the idea is to remove the Tensor Flow dependency for the inference, but the conversion is only…
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
2
votes
0 answers

Unable to convert PyTorch model to ONNX: Multiple dynamic inputs needed

I am new to PyTorch, and I built a custom BiLSTM model for sentiment analysis that uses pretrained Word2Vec embeddings. As the text I am passing in is variable in length, my forward method needs to pass in both the text and its length to use…
Toby T
  • 43
  • 1
  • 6
2
votes
0 answers

Converting Pytorch model with NonZero operations to TensorRT

I'm trying to convert Pytorch model containing NonZero operations to TRT. I've successfully saved it as ONNX, but neither TensorRT support the operation natively nor existing converters like https://github.com/onnx/onnx-tensorrt Could you please…
2
votes
2 answers

Is it possible to train ONNX models developed in tensorflow and pytorch with C++?

I wonder if its possible to use tensorflow and pytorch models converted to onnx models to train them with the C++ Api like it is done in e.g. https://gist.github.com/asimshankar/5c96acd1280507940bad9083370fe8dc with a tensorflow model. I just found…
Usaint
  • 33
  • 6
2
votes
1 answer

Bart model inference results after converting from hugginface to onnx

I followed the instructions to convert BART-LARGE-CNN model to ONNX here (https://github.com/huggingface/transformers/blob/master/docs/source/serialization.rst) using transformers.onnx script. The model was exported fine and I can run…
ZWang
  • 832
  • 5
  • 14
2
votes
0 answers

YOLO returns different results when executed in ONNX runtime

I'm trying to replicate the results this Real-time Detection of Personal-Protective-Equipment (PPE) model besides the code they do provide the dataset and trained models on google drive First I run the code with the original model, then I do it with…
Luis Ramon Ramirez Rodriguez
  • 9,591
  • 27
  • 102
  • 181
2
votes
1 answer

Cannot convert TensorFlow (Keras) model to ONNX

I'm trying to convert a saved TensorFlow model to the ONNX format, but am getting the following error. in _load_nodes slot_variable = optimizer_object.add_slot( AttributeError: '_UserObject' object has no attribute 'add_slot' I used Keras (2.6)…
Igor Ševo
  • 5,459
  • 3
  • 35
  • 80
2
votes
0 answers

Is there a way to include a model description when using `torch.onnx.export`?

Problem description We would like our onnx models to have some form of description, and ideally some other metadata including our internal version number. Currently we train with pytorch lightning and use onnxruntime for inference. Below is a…
this_josh
  • 333
  • 2
  • 11
2
votes
1 answer

ONNX model inference produces different results for the same input

I'm testing the ONNX model with one identical input for multiple inference calls, but it produces different results every time? For details, please refer to the below Colab…
Hank
  • 21
  • 2
2
votes
3 answers

How to convert YOLOv5 PyTorch model to OpenCV DNN compatible format

Could anybody please help me to convert YOLOv5 PyTorch model to ONNX or TensorFlow format to be able to use it with OpenCV C++ inference? I used this tutorial to train the model with colab:…
al072
  • 79
  • 2
  • 14
2
votes
1 answer

Error in loading ONNX model with ONNXRuntime

I'm converting a customized Pytorch model to ONNX. However, when loading it with ONNXRuntime, I've encountered an error as follows: onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception…
nguyendhn
  • 423
  • 1
  • 6
  • 19
2
votes
1 answer

ONNX C# :How Do I go about reading this object and extracting the probability value?

I've saved an ONNX-converted pretrained RFC model and I'm trying to use it in my API. I am able to call the saved model and make my prediction however I can't get my predicted value. The response is very complicated and I can't seem to figure it…
confusedstudent
  • 353
  • 3
  • 11