I need to translate an onnx model to keras (I’m using the unmaintained onnx2keras and modifying it as needed), and I’m bumping into an issue that’s proving hard to deal with.
The problem occurs when I attempt to add a numpy array to the output of a Keras layer with Add, or when I try to do the same kind of operation with Concat. I don’t want to use Lambda layers – these are problematic for me due to the fact that I need more follow-up translation steps. I’m able to create the Add layer initially, but part of the process involves getting a config dictionary from the Keras model and then recreating the model from the config. If I do this identity operation - model to config and back to model - I get a Keras error on dimension comparison between the layer output and the numpy array. The numpy array is of shape (1,63) and the layer output is (None,63) in the case of Add. The Keras shape checking code seems to think that the array has shape (1,(),(),()… 63 times(!)).
Can anyone help me with this issue? Unfortunately I’m not so knowledgeable in Keras, so I could be missing something simple.
Thanks.