tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

Is it possible to add a decode_predictions layer to converted Keras models?

Open george-synx opened this issue 2 years ago • 1 comments

Ask a Question

In the example notebook for converting keras CV models (https://github.com/onnx/tensorflow-onnx/blob/main/tutorials/keras-resnet50.ipynb) the keras method decode_predictions is used to translate the outputs of both the keras model and ONNX model. I'm not interested in the gradients and would like the decoded predictions in ONNX without having to import keras, is this possible? My downstream plan is to deploy the ONNX model via TensorRT, and currently it doesn't like the gradient outputs.

Further information

  • Is this issue related to a specific model?
    I am using a Keras CV retinanet for object detection, with a ResNet50 backbone, however the question stands for all CV style networks

Model opset: 15

Notes

https://github.com/onnx/tensorflow-onnx/blob/main/tutorials/keras-resnet50.ipynb

george-synx avatar Oct 19 '23 09:10 george-synx

The mtehod decode_predictions aims to process data while tf2onnx is focusing on convert those tf ops to onnx ops to support the algorithm in model. So we can't convert this method to any ONNX op.

fatcat-z avatar Oct 27 '23 10:10 fatcat-z