[Python] Changing MobileNet Dropout After Loading

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I am working a transfer learning problem. When I create a new model from just the Mobilenet, I set a dropout.

    base_model = MobileNet(weights='imagenet', include_top=False, input_shape=(200,200,3), dropout=.15)
    x = base_model.output
    x = GlobalAveragePooling2D()(x)
    x = Dense(10, activation='softmax')(x)


    I save models as I train using model_checkpoint_callback. As I train I find where overfitting is happening and adjust the amount of frozen layers and the learning rate. Can I also adjust dropout when I save a loaded model again?

    I saw this answer but there are no actual dropout layers in Mobilenet, so this

    for layer in model.layers:
    if hasattr(layer, 'rate'):
    print(layer.name)
    layer.rate = 0.5


    doesn't do anything.

    Continue reading...

Compartilhe esta Página