I have a “DepthWiseconv2D” quantization support training Mobilenetv2 model.
Saved in the “Save Model” format.
It is possible to convert a saved model to TFLite.
QualComm SDK Command "SNPE-TENSORFLOW-TO-DLC] issues the following error:
KeyError: ‘__INERFERENCE_DEPTHWISE1_LAYER_CALL_FN_6443’
When checked with the “saved_model_cli” command, the following error occurs:
KeyError: ‘__inerence_depthwise_conv2d_layer_call_fn_978’
Why do you get an error? Is there a workaround?
I saved the “DepthWiseconv2D” model in the “Saved Model” format.
When checked with the “saved_model_cli” command, the following error occurs:
KeyError: ‘__inerence_depthwise_conv2d_layer_call_fn_978’
This problem is an error similar to the qualcomm’s SDK command “SNPE-TENSORFLOW-TO-DLC”.
Are “Save model” support “DepthWiseconv2D”?
If your final purpose is to use SNPE, try to quantize with their tools, exporting the float model with tflite and then transform it to their .dlc format.
converter = tf.lite.TFLiteConverter.from_keras_model(model) # model is a tf.keras.Model
tflite_model = converter.convert()
with open(tflite_path, 'wb') as f:
f.write(tflite_model)
You could also quantize with tensorflow lite and perform QAT converting the final model to tflite, however Qualcomm seems to not support yet many stuff for tflite (if you try full-integer quantization it will give you a bunch of problems). Maybe check the version 1.53.2 Snapdragon Neural Processing Engine SDK: Revision History
also just as a tip, try to look your network in the netron app, that will give you some hints about the inputs and how the layers are working inside the model
Thank you for your reply!
Quantize Aware tflite fails dlc conversion.
Mobilenetv2 Normal tflite → DLC: OK
Mobilenetv2 Quantize aware tflite → DLC: NG