ONNX Runtime is a cross-platform inference and training machine-learning accelerator.
Questions tagged [onnxruntime]
292 questions
1
vote
2 answers
Building models in ONNX
Is it possible to build a model in ONNX without using a different deep learning framework (e.g. PyTorch, TensorFlow, etc.)?
In PyTorch, I would write a model like this:
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
…

Joseph Konan
- 666
- 2
- 8
- 18
1
vote
2 answers
NN model format conversion tflite -> onnx
I'd like to convert the hosted models TensorFlow-Lite hosted models mainly the mobilenets into ONNX format. So I'd like to try the quantized version of those hosted models and run them with onnx-runtime.
What would be the right procedure for…

user3428154
- 1,174
- 5
- 18
- 38
1
vote
2 answers
Ordering of Tensor into linear array in Ort:Value:CreateTensor
This seems so basic, but for some reason, I can't find any clear documentation on it.
So lets say I know my ONNX model wants an input of shape [245, 245, 3]. The second argument in the constructor Ort::Value::CreateTensor wants a linear array of…

Tullhead
- 565
- 2
- 7
- 17
1
vote
1 answer
Can you save and use customer parameters when saving a catboost model with onnx?
I have a Catboost regression model that I'm saving with onnx to use elsewhere, all using Python. Is it possible to save custom parameters in the onnx model and extract them with onnx runtime? I'd like to save metadata around the model.

Laura
- 51
- 2
1
vote
2 answers
How to find Version number of Onnx?
How do I tell if I have Onnx 1.5 installed? Why doesn't the onnxruntime.dll have it's "fileversion" set which would make things simple. Is there an API call (in C/C++) to ask the version number?

Tullhead
- 565
- 2
- 7
- 17
1
vote
1 answer
How can I fix ValueError in object detection application?
I am trying to add bounding boxes to an image using onnxruntime and opencv to be detect objects with the yolov2 neural network. Instead, I get an error at runtime.
I converted the input image into a compatible tensor / numpy array to feed into the…

Ayaz Amin
- 180
- 3
- 11
1
vote
0 answers
onnxruntime - exporting scikit RandomForestClassifier fails on import
I've exported an scikit RandomForestClassifier model to ONNX using WinMLTools.
When I tried to import the file using ONNXRuntime (on C#). I get the following error:
System.AccessViolationException: 'Attempted to read or write protected memory. This…

Nissim
- 6,395
- 5
- 49
- 74
0
votes
0 answers
are there any methods to get per layer inference time of an onnx model?
The code is like
import onnxruntime
onnx_input= np.random.normal(size=[1, 3, 224, 224]).astype(np.float32)
ort_sess = onnxruntime.InferenceSession('model.onnx')
ort_inputs = {ort_sess.get_inputs()[0].name: onnx_input}
ort_outs = ort_sess.run(None,…

rufuss
- 1
- 1
0
votes
0 answers
ModuleNotFoundError when running python in Google colab
I'm running Google colab in a local session on my machine. When I try and run a python script with the import of onnxruntime I get the error: ModuleNotFoundError: No module named 'onnxruntime'
I've installed both onnxruntime and onnxruntime-gpu, so…

Robert Guzman
- 11
- 3
0
votes
0 answers
Error on InferenceSession while loading onnxmodel with directML in ML.net
I'm quite new with pytorch, deep learning and neural network.
I'm trying to fine tuning a fastrcnn model to find holes and tubes in images with a c# application.
I've fine tuned the model, saved it in onnx format and used it with ml.net and it…

filtrow
- 1
- 2
0
votes
0 answers
I get "ONNX/omp.h file not found" after I add the ONNX iOS runtime to my Xcode project?
I'm trying to add an ONNX AI model and the ONNX runtime .xcframework to my Xcode static lib swift .xcodeproj project.
But when I build I get error:
ONNX/omp.h file not found
I created a Podfile ("pod init" and "pod install") in the folder with the…

Doug Null
- 7,989
- 15
- 69
- 148
0
votes
0 answers
How to resolve "Unable to find a shape calculator for type ''"
I have trained a XGB classifier and want to convert it into onnx model. I am using skl2onnx for this and getting below error:
Unable to find a shape calculator for type ''
Tried it resolving it after finding a…

Abhishek Gangwar
- 1,697
- 3
- 17
- 29
0
votes
0 answers
Running Onnx file from Mendix studio pro
I want to understand how can I use ONNX model in mendix studio pro , I checked all the documentation from mendix and tried implementing it in mendix studio pro, but I'm not able to figure out how can I pass any inputs to roberta_base_11 ONNX model…

Aravind
- 1
- 1
0
votes
0 answers
Can't convert pytorch model with dynamically changing **kernel** shape to ONNX
I have a PyTorch model that performs correlation between the dynamically changing shapes of template and search images. For example:
The pytorch model code:
class Model(nn.Module):
def __init__(self) -> None:
super().__init__()
def…

88 gps.
- 11
- 2
0
votes
1 answer
Onnx Adapter Transformer Support
Does a model saved to onnx/ tensorRT format format supports adapter models plug just like we can do it in PyTorch or Tensorflow? If there is any proper tutorial or someone can provide details of it, would be appreciated.
I have tried to find in…

Sajal
- 96
- 1
- 5