-1

I have the customized onnx model and want to implement it into specific embedded device.

Before to implement it, It is needed to convert the model to the embedded device compatible model.

But the thing is that..

My model has Bilinear resize layer(ResizeBilinear) but the conversion tool only supports Nearest Neighbor(ResizeNearestNeighbor) method conversion.

So my question is

Is there any way to change the Bilinear resize layer to Nearest Neighbor resize in Saved model of TF2.X, or frozen graph of TF1.X, or onnx model?

Actually, I have original onnx model and converted it into saved_model of tf2 and frozen_graph of tf1, because the conversion tool supports frozen_grpah of tf1 only.

Thanks.

Seongkyun Han
  • 119
  • 1
  • 2
  • 8

1 Answers1

1

Yes, you can edit the onnx model directly. Try using the onnx2py script.

pip install onnxconverter-common

python -m onnxconverter_common.onnx2py model.onnx model.py

Then edit model.py and make the new model

python model.py new_model.onnx