I have a model with input layer as shape (None,128,128,1)
Model: “model”
Layer (type) Output Shape Param #
input_1 (InputLayer) [(None, 128, 128, 1)] 0
conv2d (Conv2D) (None, 126, 126, 16) 160
max_pooling2d (MaxPooling2D) (None, 63, 63, 16) 0
conv2d_1 (Conv2D) (None, 61, 61, 32) 4640
max_pooling2d_1 (MaxPooling2 (None, 30, 30, 32) 0
flatten (Flatten) (None, 28800) 0
dense (Dense) (None, 128) 3686528
dense_1 (Dense) (None, 10) 1290
Total params: 3,692,618
Trainable params: 3,692,618
Non-trainable params: 0
now i have trained and saved the model and later loaded the model USING
new_model = tf.keras.models.load_model('saved_model/my_model')
``
Now i want to change the input layer with shape (256,256,1)
and use the rest of the model weights the same
how can I do this?
What I have tried
```python
new_model.layers.pop(0)
mode=tf.keras.Sequential()
mode.add(tf.keras.Input(shape=(256,256,1)))
for lay in new_model.layers[1:]:
mode.add(lay)
none of these work for me
is there a way?