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

'TypeError: value "unknown_rank: true " is not valid attribute data type' for model with TensorArrayConcatV3

Open pks opened this issue 2 years ago • 1 comments

Hi,

I'm trying to convert a seq2seq Tensorflow v1.x model but get the following error when calling python -m tf2onnx.convert --checkpoint [...]:

2022-08-12 12:00:41,703 - INFO - Using tensorflow=2.9.1, onnx=1.12.0, tf2onnx=1.12.0/a58786
2022-08-12 12:00:41,703 - INFO - Using opset <onnx, 17>
2022-08-12 12:00:50,655 - ERROR - pass1 convert failed for name: "[redacted]/cond/while/TensorArrayConcatV3"
op: "TensorArrayConcatV3"
input: "[redacted]/cond/while/TensorArrayConcatV3/Enter"
input: "[redacted]/cond/while/Identity_2"
attr {
  key: "dtype"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "element_shape_except0"
  value {
    shape {
      unknown_rank: true
    }
  }
}
, ex=value "unknown_rank: true
" is not valid attribute data type.
[redacted stacktrace]
TypeError: value "unknown_rank: true
" is not valid attribute data type.

I'd appreciate any pointer to make this work. I could only find this https://github.com/onnx/tensorflow-onnx/issues/1395 issue, but it is different from mine.

pks avatar Aug 12 '22 12:08 pks

Somehow, the frozen tensorflow graph contains an attribute "unknown_rank" which is not valid.

Since the model is TF v1.x version, could you please try this with TF v1.15? If still got the same issue, is it possible you can share the checkpoint with us so we can have a local debug?

fatcat-z avatar Aug 23 '22 09:08 fatcat-z

Thanks @fatcat-z. Unfortunately we cannot go back to TF1.15 with our codebase. However, in the meantime we gave up on this approach. Thanks for looking into it anyway!

pks avatar Oct 19 '22 14:10 pks