LSTM seq length cast node is causing error while removing unused nodes #489
Description
_remove_unused_nodes() is failing for my model. Unfortunately, I can't share you the model.
assert in_ == '' or in_ in input_dict
(https://github.com/onnx/keras-onnx/blob/master/keras2onnx/topology.py#L230)
Above check is failing me. My values are:
>in_
'masking_1/Any_1:0'
>in_ in input_dict
False
This check was part of the recent change #466
you can see the 'masking_1/Any_1:0' was input of 'cast' node which was build at:
https://github.com/onnx/keras-onnx/blob/master/keras2onnx/ke2onnx/lstm.py#L291
keras-onnx/keras2onnx/ke2onnx/simplernn.py
Line 150 in a75bfa5
I am assuming 'masking_1/Any_1:0' to be part of 'input_dict' in _remove_unused_nodes() but is not the case.
Shouldn't we add cast input here into container.add_initializer()?
Env: Keras 2.3.1, keras-onnx master (as of May12th 2020), Py 36