'TFF: 'trainable=True ' causes decrinsing of accuracy

I work with TFF, here is a part of my code :

def create_keras_model():
    
    baseModel = tf.keras.applications.ResNet50(include_top=False, weights=None, input_tensor=tf.keras.Input(shape=(224, 224, 3)))

    for layer in baseModel.layers:
        layer.trainable = False
    return model

With this model I find test-accuracy value = 0.8 Now, I would like to change layer.trainable = True, but the test-accuracy value decrease to 0.2 and loss becomes 12 . which is not normal, can anyone tell why.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source