onnx / tensorflow-onnx

Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX
Apache License 2.0
2.31k stars 430 forks source link

ERROR - Unsupported ops: Counter({'SigmoidGrad': 2, 'StridedSliceGrad': 1}) #1926

Open goncaloLopesMarques opened 2 years ago

goncaloLopesMarques commented 2 years ago

Bug Description I´m trying to convert a saved model to oonx file with this command line "python -m tf2onnx.convert --saved-model "input path" --output "output path My_Class_Model.onnx" --opset 15"

and give me this errors:

ERROR - Unsupported ops: Counter({'SigmoidGrad': 2, 'StridedSliceGrad': 1}) ERROR - Tensorflow op [StatefulPartitionedCall/gradient_tape/grad_cam__class/model/Head_fc/swish_activation_1/Sigmoid/SigmoidGrad: SigmoidGrad] is not supported ERROR - Tensorflow op [StatefulPartitionedCall/gradient_tape/grad_cam__class/model/Head_out_fc/Sigmoid/SigmoidGrad: SigmoidGrad] is not supported

System information

To Reproduce Describe steps/code to reproduce the behavior. Please upload/link the model you are trying to convert if possible.

Screenshots

error1 error2

.

fatcat-z commented 2 years ago

These 2 ops are not supported yet and there is no plan so far.

goncaloLopesMarques commented 2 years ago

@fatcat-z and no custom domain to add to custom ops? nothing? any tutorial to add this ops?

fatcat-z commented 2 years ago

@fatcat-z Jay Zhang FTE and no custom domain to add to custom ops? nothing? any tutorial to add this ops?

These 2 ops are TensorFlow op so we don't add them as a custom op. You can convert them to ONNX op with the default domain.

Please feel free to refer to https://github.com/onnx/tensorflow-onnx/pull/253/files for how to convert a TensorFlow op to an ONNX op.

fatcat-z commented 2 years ago

Ideally, these ***Grad ops should not exist after we freeze the graph. Will take a look.

hwangdeyu commented 2 years ago

Hi @goncaloLopesMarques , could you share your example save_model or micro reproduction code then we can help to see what happened?

thomasjeff0420 commented 9 months ago

Hi I have the same problem when I convert my model from frozen graph to ONNX, could anyone spot out the differences between 2 sigmoid please?

ảnh my model ảnh my sample