Conversion Failure Caused by the Default Value of input_shape
Symptom
Model conversion fails, and the log message "input x shape is empty" is printed, as shown in Figure 3-4.
Possible Cause
The possible cause is as follows:
The input of the original TensorFlow model has a dynamic shape, for example, ? x 299 x 299 x 3. The default value of input_shape is used during model conversion. As a result, an error is reported.
Solution
- Use the Netron tool to view the model and confirm the input shape of the model.
- For a dynamic shape model, the input_shape argument must be added during conversion. Command example:
atc --model=./resnetv2.pb --framework=3 --input_shape="input_tensor:8,299,299,3" --input_format="NHWC" --output=./resnetv2 --soc_version=Ascend310