Does DL4J load “Functional” model? The tutorial shows we need to generate “Sequential” model in order to load in to DL4J.
To import a Keras model, you need to create and serialize such a model first.
Sequential model example:
model = keras.Sequential([keras.Input((32,)), keras.layers.Dense(1)])config = model.get_config()new_model = keras.Sequential.from_config(config)
Functional model example:
inputs = keras.Input((32,))outputs = keras.layers.Dense(1)(inputs)model = keras.Model(inputs, outputs)config = model.get_config()new_model = keras.Model.from_config(config)