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

the results of mlmodel using ANE is wrong, but results of gpu and cpu are correct

There is a strange problem about my fcn-mobilenetv2 mlmodel. I convert this mlmodel from onnx using onnx-coreml tool with target=ios12. It can run on ANE because the speed is much faster than CpuAndGpu. However the results of ANE are totally wrong,…
0
votes
1 answer

ML.net - error when consuming ONNX in ML.net

Using ML.net in my .NET core app I'm trying to consume a KERAS LSTM model that I exported to an ONNX file. Here is my code: using Microsoft.ML; using Microsoft.ML.Data; using Microsoft.ML.Transforms.Onnx; public void getmodel(mydata[] data1) { …
dunkleosteus
  • 336
  • 1
  • 12
0
votes
0 answers

Onnx to mlmodel conversion fails to generate .mlmodel file

I'm trying to convert Pytorch model to MLModel with Onnx. My code: import torch from onnx_coreml import convert import coremltools net = BiSeNet(19) net.cuda() net.load_state_dict(torch.load('model.pth')) #net.eval() dummy =…
user10007342
0
votes
0 answers

Input 'input_image' of layer '63' not found in any of the outputs of the preceeding layers

Update #1 (original question and details below): As per the suggestion of @MatthijsHollemans below I've tried to run this by removing dynamic_axes from the initial create_onnx step below. This removed both: Description of image feature 'input_image'…
BorisKourt
  • 187
  • 2
  • 15
0
votes
1 answer

PyTorch - convert ProGAN agent from pth to onnx

I trained a ProGAN agent using this PyTorch reimplementation, and I saved the agent as a .pth. Now I need to convert the agent into the .onnx format, which I am doing using this scipt: from torch.autograd import Variable import torch.onnx import…
albus_c
  • 6,292
  • 14
  • 36
  • 77
0
votes
0 answers

"Exception from Layer: 149" Problem with CoreML model after converting from PyTorch

I trained a YOLOv3-SPP model using PyTorch. I then saved it as an ONNX model and then converted it to CoreML using onnx-coreml. When I try to make a prediction using the model I get this error: YOLOv3-CoreML[13481:1004975] [espresso]…
coder
  • 381
  • 2
  • 22
0
votes
1 answer

Saving gensim LDA model to ONNX

Is there a way to save a gensim LDA model to ONNX format? We need to be able to train using Python/gensim and then operationalize it into an Onnx model to publish and use.
0
votes
0 answers

Converting from tensorflow frozen graph to tflite for android inference

I'm trying to convert from pytorch to tflite for android inference for a app I'm working on that uses real-time camera data of basketball to create a heatmap of made and missed shots. It's already working for iOS. Here's a demo. I've managed to…
0
votes
0 answers

Load ONNX model in opencv2 fails with blob.type() assertion error

OS: Raspian GNU/Linux 9 Python: 3.6.6 OpenCV: 4.1.1 When I load an ONNX model in OpenCV DNN I get the following error: cv2.error: OpenCV(4.1.1) /home/pi/opencv-python/opencv/modules/dnn/src/onnx/onnx_importer.cpp:505: error: (-215:Assertion…
J. Lee
  • 21
  • 2
0
votes
0 answers

How to convert Core ML model file to other format so it can run on a server

A Core ML model (.mlmodel) was trained but I found it can only run on MacOS. (But I want to run it on a Linux server) I tried to convert it to ONNX format but failed. onnxmltools and following python code was used for the conversion: import…
oOEric
  • 1,069
  • 1
  • 10
  • 25
0
votes
1 answer

Error when Converting Node Type Slice with onnx_coreml

I have converted my darknet YOLOv3-SPP model into a PyTorch .pt model. I then converted the .pt to a .onnx. My end goal is to get to a CoreML model. I tried to use this GitHub repository. However when converting my model I am getting an error like…
coder
  • 381
  • 2
  • 22
0
votes
1 answer

how do I change all pertinent instances of uint8 to int8 in my tensorflow model

I am converting a frozen pb model to onnx, but onnx does not support uint8. How do I go about replacing uint8 with int8 in the model file? I can also retrain if I have to, but I am not sure which file to modify and how. I would have guessed that I…
Ivan Viti
  • 271
  • 2
  • 11
0
votes
1 answer

Is it possible to get tree decision_path from calls to sklearn models saved with skl2onnx?

For example following: https://github.com/onnx/sklearn-onnx/blob/master/docs/tutorial.rst But with model = sklearn.ensemble.RandomForestRegressor() We can get a hold of models.estimators_[0].decision_path(X) Can we do this with a model converted…
mathtick
  • 6,487
  • 13
  • 56
  • 101
0
votes
0 answers

PyTorch to ONNX conversion problem - torch.randn

Using this reimplementation of StyleGAN in PyTorch, I am trying to export the generator as an .onnx file using the following code: import model import torch Gen = model.StyledGenerator(512) dummy_input = torch.randn(1,512) model1 =…
albus_c
  • 6,292
  • 14
  • 36
  • 77
0
votes
1 answer

Deploying the converted R-CNN Detector from Matlab to ONNX TO raspberry

I am working on a project using R-CNN detector (Regional convolutional neural network) for object detection. I created the detector and trained by Matlab and tested and it works fine however when I come to the stage to test it and deploy it to…