1

I've being messing around on how to make transferleaning from a saved model. My case is resnet50_coco_best_v2.1.0.h5, aftear loading it like

and then I try to add it to my new model

resnet50Coco = models.load_model(url_model, backbone_name='resnet101')

new_resnet50Coco = resnet50Coco.get_layer('filtered_detections')

inputs = Input(shape=(256,256,3))
SalidaResnet50Coco = Model(inputs = inputs, outputs = new_resnet50Coco.output)

model = Sequential()
model.add(SalidaResnet50Coco )
model.add(Conv2D(512, 5, strides = (1),  padding='same', activation='relu'))
model.add(Conv2D(1024, 5, strides = (1) , padding='same', activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2),strides=2))  
 
model.add(Flatten())
model.add(Dense(10, activation='relu'))
model.add(Dense(8, activation='softmax'))
model.layers[0].trainable=False

model.summary()

If you can bring me any help on how should I create a new model from a saved one I will apreciate it.

0 Answers0