parsa
parsa

Reputation: 370

changing a trained static input shape to dynamic shape in keras

I have trained my MobileNetV3Small with 2 dense layers and got my result. but I set 640,480,3 as my input shape and now I need to test some images with different sizes. as it starts with convolution layers size must not matter. but I received errors as it requires its defined size (640,480,3) and padding and resizing didn't perform well. so I want to change the input shape to (None, None,3) without retraining it from scratch. It took 3 days to train my model and I don't want to train it again to change the input size.

Upvotes: 0

Views: 979

Answers (1)

Pauuuuuuul
Pauuuuuuul

Reputation: 275

Maybe you could try this on your Keras.Model instance:


model.input.set_shape((None, None, 3))

Upvotes: 2

Related Questions