ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.17k stars 310 forks source link

Unspecified dimension while using ShapeInferenceMethod::ValidateOnly when loading TFLite models #619

Closed Rahn80643 closed 2 years ago

Rahn80643 commented 2 years ago

Hi,

I'm trying to apply a BiSeNetV2 model implemented by TensorFlow2 API to Arm NN, but I met the following error message: Fatal: Armnn Error: Unspecified dimension while using ShapeInferenceMethod::ValidateOnly

armnn_error

The tflite model is converted based on the tutorial. The followings are the settings of the environment:

How to know which layer causes the error above, and is the error above related to dimension of layers?

The attachment contains the tflite model I tested on Arm NN. TF2_tflite_test.tar.gz

Best Regards, Rahn

TeresaARM commented 2 years ago

Hi @Rahn80643

When a dimension is unspecified or unknown (usually it is the batch size), we need to infer the size across the whole model. We have two "modes": ValidateOnly(the one by default) and InferOutputShape.

could you try adding to your command when calling Arm NN --infer-output-shape ?

could you have a look to issue #603 and see if it helps you

Thank you Kind regards

Rahn80643 commented 2 years ago

Hi @TeresaARM

Thank you for providing the issue thread, I can execute the command successfully with --infer-output-shape and the inference code could be executed successfully when setting m_InferAndValidate = true; as well. Thank you!

Best Regards, Rahn

TeresaARM commented 2 years ago

Hi @Rahn80643

glad to hear your model is working now!