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

BatchNormalization Layer causing error in converting from .h5 to .onnx

I need to convert a .h5 model to a .onnx, but when I use a BatchNormalization layer, the code gives the following error: TypeError: value "" is not valid attribute data type. And gives the warning: tf executing eager_mode: True tf.keras model…
2
votes
1 answer

How to get onnx format from pretrained GPT2 models?

I'm trying to transform KoGPT2 model, which is pretrained by GPT2, to onnx format in order to change the model to tensorflow format. I used convert_graph_to_onnx in transformers but it didn't work because of some reasons. I don't know what this…
Sooyong
  • 21
  • 1
2
votes
0 answers

How to perform Batch inferencing with RoBERTa ONNX quantized model?

I have converted RoBERTa PyTorch model to ONNX model and quantized it. I am able to get the scores from ONNX model for single input data point (each sentence). I want to understand how to get batch predictions using ONNX Runtime inference session by…
2
votes
0 answers

ML.Net PredictionEngine.Predict is returning emtpy object

I trained a Resnet50 (640x640) model from tensorflow models zoo and then converted it to "onnx" format and I am trying to run it with ML.Net The object returned by the "PredictionEngine.Predict" is empty, all the fields are null. The tutorial from…
pascx64
  • 904
  • 16
  • 31
2
votes
2 answers

convert yolov5 model to ONNX and run on c++ interface

I have yolo model as yolov5s.yaml and i have saved my weights file as best.pt . Now want to convert yolo model to ONNX and run on c++ interface . I have gone through this https://github.com/ultralytics/yolov5/issues/251 but not able to do .Any help…
k_p
  • 283
  • 6
  • 17
2
votes
0 answers

aws gpu oom issue onnx cuda

Doing predictions on AWS GPU instance g4dn.4xlarge(16gb gpu memory,64 gb cpu mem) and deployed with k8s & dockers. Tested with (cuda10.1 + onnxruntime-gpu==1.4.0 ) and (cuda10.2 + onnxruntime-gpu==1.6.0) same error.Models are customised for our…
tsoulb
  • 41
  • 4
2
votes
1 answer

Why keras2onnx.convert_keras() function keeps getting me error "'KerasTensor' object has no attribute 'graph'"

I have a trained model (Which I trained myself), which is a .h5 format, It works fine by itself, but I need to convert it to .onnx format for deploying it inside Unity Engine, I searched how to convert .h5 models to .onnx format and stumbled upon…
2
votes
2 answers

'No schema registered' in ONNX model conversion

I am using kaggle notebook. I am trying to convert my pytorch model into tensorflow model to run with tensorflowJS. I used below code to convert onnx model to tensorflow model- import onnx from onnx_tf.backend import prepare onnx_model =…
ameya
  • 201
  • 2
  • 16
2
votes
2 answers

Does converting a seq2seq NLP model to the ONNX format negatively affect its performance?

I was looking at potentially converting an ml NLP model to the ONNX format in order to take advantage of its speed increase (ONNX Runtime). However, I don't really understand what is fundamentally changed in the new models compared to the old…
2
votes
2 answers

Can I combine two ONNX graphs together, passing the output from one as input to another?

I have a model, exported from pytorch, I'll call main_model.onnx. It has an input node I'll call main_input that expects a list of integers. I can load this in onnxruntime and send a list of ints and it works great. I made another ONNX model I'll…
maccam912
  • 792
  • 1
  • 7
  • 22
2
votes
1 answer

ML.NET export to ONNX

NET GUI tools to train model. The model works great with C# application, but I want to have it in ONNX format. I have found tools which are converting between model formats, but couldn't find anything for ML.NET generated format. Apparently it's…
r9guy
  • 65
  • 7
2
votes
2 answers

How to do multiple inferencing on onnx(onnxruntime) similar to sklearn

I want to infer outputs against many inputs from an onnx model using onnxruntime in python. One way is to use the for loop but it seems a very trivial and a slow method. Is there a way to do the same way as sklearn? Single prediction on…
Sarthak Agrawal
  • 321
  • 4
  • 17
2
votes
1 answer

How to impelement post-proccesing for yolo v3 or v4 onnx models in ML.Net

I followed this microsoft tutorial and there was no problem. but i wanted to change model to yolo v3 or v4. I get the YOLOv4 onnx model from onnx/models and was able to get all three array of float outputs of yolov4 onnx model but the problem is…
Jeff
  • 33
  • 1
  • 4
2
votes
1 answer

How to convert channel last keras model into channel first ONNX model

I want to convert keras .h5 model into ONNX model. But my model is trained channel last and I want it channel first. I found that there is an argument in keras2onnx.convert_keras called channel_first_inputs but couldn't find any example on how to…
Fadwa
  • 1,717
  • 5
  • 26
  • 43
2
votes
1 answer

AWS Lambda - How to Put ONNX Models in AWS Layers

Currently, I have been downloading my ONNX models from S3 like so: s3 = boto3.client('s3') if os.path.isfile('/tmp/model.onnx') != True: s3.download_file('test', 'models/model.onnx', '/tmp/model.onnx') inference_session =…
Shawn Zhang
  • 1,719
  • 2
  • 14
  • 20