For more complex models, there’s an easier way. If model
is the original model, you can create a copy using tf.model({inputs:model.inputs, outputs: model.layers[2].output})
, thereby only needing to provide the first and last layer
CLICK HERE to find out more related problems solutions.