Specify input shape when converting Keras H5 model into IR format.
- Converted Keras H5 model using the following command:
mo --saved_model_dir model/
- Encountered the following error:
[ ERROR ] Shape [-1 30 30 3] is not fully defined for output 0 of "conv2d_input".
Use --input_shape with positive integers to override model input shapes.
- Could not determine the value for the --input_shape parameter.
Input shape values are in the order of [N,H,W,C] for TensorFlow* models. The meaning for each letter are as follows:
Letter | Meaning |
N | Number of images in the batch |
H | Height of the image |
W | Width of the image |
C | Number of channels of the image (ex: 3 for RGB, 1 for grayscale…) |
Convert the Keras H5 model using the following command:
python3 mo --saved_model_dir <path_to_model> --input_shape [1,30,30,3]