I am trying to change the input layer's name of a Pre-trained TensorFlow model imported from Keras
I am able to add the output layer name but I keep failing in adding input model name. Is it even possible to change the input layer name of a pre-trained model?
I can't find any info about this in keras documentation as well. Not sure if I am missing something.
tf_model = Sequential(name = 'mobilenet_model')
pretrained_model = tf.keras.applications.MobileNetV3Small(include_top = False,
input_shape = (180, 180, 3),
pooling = 'avg',
classes = len(CLASS_NAMES),
weights = 'imagenet')
for layer in pretrained_model.layers:
layer.trainable = False
tf_model.add(pretrained_model)
tf_model.add(Flatten())
tf_model.add(Dense(512, activation = 'relu'))
tf_model.add(Dense(len(CLASS_NAMES), activation = 'softmax', name = 'MODEL_OUTPUT_LAYER'))
tf_model.summary()
Currently the input model name is the default "MobilenetV3small" but I want to change it to something else.

Got a potential solution from here - Keras rename model and layers guys.
The solution is to use _name property before compiling the model.
However, it doesn't change the pre-trained model's name.