I want to finetune resnet50 model. But my data's label are just binary, so I have to adapt new full connected layer on top of resnet 50's convolutional layers.
Conceptually, my situation is like below,
model = ResNet50(include_top=False, weights='imagenet') # Functional API
top_model = TopModel(model.output_shape[1:])
top_model.load_weights("top_model.hdf5")
model.add(top_model) # => AttributeError: 'Model' object has no attribute 'add'
My question is,
Is there any easy way to stack 'Sequential based' model on 'Functional API based' model ??
I mimic following codes.
model = ResNet50(include_top=False, weights='imagenet') # Functional API
top_model = TopModel(model.output_shape[1:])
top_model.load_weights("top_model.hdf5")
# Stack top_model on top
model = Model(input=model.input, output=top_model(model.output))
Thanks for the great responses!
Most helpful comment