onnx-tensorflow
onnx-tensorflow copied to clipboard
RuntimeError: GRU with linear_before_reset is not supported in Tensorflow.
Please find the error log:
RuntimeError: in user code:
/usr/local/lib/python3.6/dist-packages/onnx_tf/backend_tf_module.py:98 __call__ *
output_ops = self.backend._onnx_node_to_tensorflow_op(onnx_node,
/usr/local/lib/python3.6/dist-packages/onnx_tf/backend.py:289 _onnx_node_to_tensorflow_op *
return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/handler.py:58 handle *
cls.args_check(node, **kwargs)
/usr/local/lib/python3.6/dist-packages/onnx_tf/handlers/backend/gru.py:68 args_check *
exception.OP_UNSUPPORTED_EXCEPT("GRU with linear_before_reset",
/usr/local/lib/python3.6/dist-packages/onnx_tf/common/exception.py:50 __call__ *
raise self._func(self.get_message(op, framework))
RuntimeError: GRU with linear_before_reset is not supported in Tensorflow.
ONNX Version used - 1.8 ONNX-TF Version Used - 1.7
This is a known limitation in conversion using Tensorflow APIs. The support status for onnx-tf 1.7 can be found here, https://github.com/onnx/onnx-tensorflow/blob/master/doc/support_status_v1_7_0.md
Ok Are there any alternatives to bypass this error
Change the GRU linear_before_reset to 0 or remove the attribute in onnx model. Contribution to support of this attribute is highly welcome!
@chinhuang007, force the attribure linear_before_reset to 0 seems to cause some dimension error, is there any plan to support this feature, I saw tf.keras.layers.GRU has the argument reset_after=false, but I failed after trying.
any fix now? i still get the same error
I had the same problem
I had the same problem
I didn't experience any change in dimensions when forcing linear_before_reset to 0, but the values are definitely incorrect. It looks like there's a PR from years ago that solved this issue but was left to the wayside while waiting to update to tf2.0: https://github.com/onnx/onnx-tensorflow/pull/452 would love to see it updated as needed and implemented as it appears to be the only thing blocking pytorch -> tf conversion with GRUs at this point
@all, did anyone find a way to resolve this issue? Any suggestions would help greatly. Thanks
I think I have implemented it, but I don't know if it works correctly because I don't have enough ONNX files for testing.
It's a topic that's over a year old, so no one will be interested in it.
https://github.com/PINTO0309/onnx2tf/blob/main/onnx2tf/ops/GRU.py