You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to document an issue I ran into and the resolution in case anyone else runs into it, and to propose an api improvement, if possible, that would make the issue less difficult in the future.
I got the above error while trying to load a Keras model, and the resolution was that I needed to make sure the first layer of my model was named "input_1".
Keras has a singleton-esque pattern for naming its layers. That is, each time a layer of the same type is initialized in the same runtime, it increments the counter of the layer name. So the first time you create an input it's "input_1", the second time it's "input_2", etc...
This makes it really easy to make a model that throws the above error and not know exactly why it's happening. If it's possible, why not inspect the layers of the Keras model in cpp and use the first input layer as input by default, rather than looking for a hard-coded default name?