I have created an image classifier model based on MobileV2Net , trained it and saved it properly. when i try to load a previously saved model i constantly getting this error:
**The Error:**
`/usr/local/lib/python3.10/dist-packages/keras/src/layers/input_spec.py in assert_input_compatibility(input_spec, inputs, layer_name) 184 if spec.ndim is not None and not spec.allow_last_axis_squeeze: 185 if ndim != spec.ndim: --> 186 raise ValueError( 187 f'Input {input_index} of layer "{layer_name}" ' 188 "is incompatible with the layer: "
ValueError: Input 0 of layer "global_average_pooling2d_7" is incompatible with the layer: expected ndim=4, found ndim=1. Full shape received: (512,) ` my code is :
`loaded_test_model=tf.keras.models.load_model('/content/drive/MyDrive/testsave/modeltest.keras')`