Questions tagged [tf2onnx]
31 questions
0
votes
0 answers
I am converting YOLOV7 .pt to tflite and stumble upon this problem
I'm trying to convert YOLOV7 model to mobile using this command line onnx-tf convert -i yolov7.onnx -o /yolov7/ and I'm getting an error message that I'm struggling to understand. The error message is:
ValueError: Dimensions must be equal, but are…
0
votes
2 answers
Which AI models can be converted to ONNX?
I think in theory, every (TensorFlow) model can be converted to ONNX because at some level it is a pretty basic neural network graph.
Is this assumption correct?
But I found that there are limitations in practice.
For instance, I found that the…

mihca
- 997
- 1
- 10
- 29
0
votes
0 answers
BackendIsNotSupposedToImplementIt Error: Converting ONNX to Tensorflow
When i run this code to convert onnx to tensorflow im getting error in google colab. I need to convert this onnx file to tensorflow lite so i can use it in android app.
from onnx_tf.backend import prepare
import onnx
onnx_model_path =…

nlp
- 15
- 5
0
votes
0 answers
Converting a TensorFlow hub saved .pb model into Onnx
Hello I have a multilingual transformer model from TensorFlow hub that I want to convert into an ONNX model: (MODEL)
I have tried tf2onnx convert many times and wansn't successful.
Model Signature Def:
signature_def['__saved_model_init_op']:
…

Akella Niranjan
- 33
- 1
- 8
0
votes
1 answer
Convert a model from tf_hub to onnx using tf2onnx
I downloaded a model from tensorflow hub, and then tried to convert it into onnx using tf2onnx (https://github.com/onnx/tensorflow-onnx).
However the model does not seem to work properly after conversion.
When I look at the onnx file that is…

Montparg
- 63
- 7
0
votes
0 answers
tf2onnx fails to convert TextVectorizer
Reproduction Steps
Setup environment
python3.10 -m venv venv
source activate venv/bin/activate
pip install -U pip
pip install tensorflow==2.8.0 tf2onnx==1.13.0 packaging==23.0
Create a model with TextVectorizer
import tensorflow as…

Maxim Blumental
- 763
- 5
- 26
0
votes
0 answers
ImportError: cannot import name 'builder' from 'google.protobuf.internal' while importing tf2onnx
I am following a tutorial to convert keras (.hdf5/.h5) model to onnx model. the link is (https://www.youtube.com/watch?v=7ndUGBzGVvg)
So, the code is
import tensorflow as tf
from tensorflow.keras.models import load_model
print(tf.__version__)
model…

Krupali Mistry
- 624
- 1
- 9
- 23
0
votes
1 answer
Onnxruntime extensions are not installing on Arm Based Processor
Error when installing onnxruntime-extensions
I also tried different versions but everytime got same error
error: could not find a version that satisfies the requirement onnxruntime-extensions (from versions: none)
error: no matching distribution…

Farid
- 72
- 10
0
votes
0 answers
Why am I getting error when using tf2onnx to convert keras model to onnx?
I have a CNN model That I trained with TensorFlow.Keras (v2.10) and I saved the best checkpoints as a .h5 file. I wanted to convert it to onnx using the following command:
python -m tf2onnx.convert --saved-model weights-chkpt-07-0.65.h5 --output…

nechi
- 53
- 6
0
votes
1 answer
How do you find the quantization parameter inside of the ONNX model resulted in converting already quantized tflite model to ONNX?
what I was trying to do is convert quantized tflite to ONNX and run it directly with ORT with tf2onnx. The network I'm trying to convert is YOLOv5 pre-trained with my own dataset + COCO and The model has been converted successfully. I'm sure of that…

PesozuSejin
- 61
- 1
- 9
0
votes
1 answer
ONNX Runtime memory arena, reuse, and pattern
As described in Python API Doc, there are some params in onnxruntime session options coressponding to memory configurations such as:
enable_cpu_mem_arena
enable_mem_usage
enable_mem_pattern
There are some descriptions for them but I can not…

Mohsen Mahmoodzadeh
- 111
- 1
- 10
0
votes
0 answers
Error on conversion of a saved Keras model to onnx
If I save a model in Keras in this way, for example:
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow import saved_model
# create random data
X = np.random.rand(10000, 8)
y…

Oliver
- 93
- 1
- 7
0
votes
1 answer
ExtractImagePatches is not supported
I'm trying to convert TensorFlow model to onnx format by tf2onnx 1.12.1. But I get errors for converting my first layers (they are BatchNormalization).
Code to create the layer:
# Layer 1
x, _ = Involution(channel=3, group_number=1, kernel_size=3,…

setareh zare
- 3
- 4
0
votes
1 answer
ONNX segmentation becomes binary
I had a segnet model I converted to ONNX using the most simple following python line:
onnx_model, _ = tf2onnx.convert.from_keras(model, [tf.TensorSpec([1,125,500,1], tf.float32)], output_path=out_path)
the ONNX works well, BUT I get an almost…

ephraim
- 379
- 1
- 3
- 15
0
votes
0 answers
Cannot save dropout layer in a tensorflow model with tf2onnx.convert.from_keras (and load it with onnx)
Describe the bug
I want to save a model that I trained with tensorflow and that contains Dropout layers. I need these layers at inference to use them in training_mode in order to measure the epistemic uncertainty of my model. I think the tf2onnx…

glm-barcelin
- 1
- 1