I got the following error while executing “relay.frontend.from_tflite(tflite_model, shape_dict, dtype_dict)”. The tflite model does not use “depthwise_conv2d” operator.
Can anybody advise how to resolve it?
Thanks,
Traceback (most recent call last):
File “/Desktop/quantization/lenet_mnist/compile_tflite_int8.py”, line 39, in
dtype_dict=dtype)
File “/usr/local/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-macosx-10.13-x86_64.egg/tvm/relay/frontend/tflite.py”, line 709, in from_tflite
op_converter.convert_op_to_relay()
File “/usr/local/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-macosx-10.13-x86_64.egg/tvm/relay/frontend/tflite.py”, line 93, in convert_op_to_relay
ret = self.convert_mapop_code_str
File “/usr/local/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-macosx-10.13-x86_64.egg/tvm/relay/frontend/tflite.py”, line 182, in convert_depthwise_conv2d
return self.convert_conv(op, “depthwise”)
File “/usr/local/lib/python3.7/site-packages/tvm-0.6.dev0-py3.7-macosx-10.13-x86_64.egg/tvm/relay/frontend/tflite.py”, line 445, in convert_conv
assert depth_multiplier == 1, "TF frontend have transformed it be 1 "
AssertionError: TF frontend have transformed it be 1 no matter original value be set by 0.25, 0.5 or any else
@apivovarov Thanks for the comment. The model is not int8 quantized model. The file name is *int8 though. I will try with mobilenet_v1 model to check if my model caused the issue. Thanks!
As of now, tf.lite.TFLiteConverter converts “Con2D” operator of the original model to “DepthwiseConv2D” in the TFlite model. Such conversion is not an issue when you infer with the converted TFLite model. However, when I parse and convert the TFlite model into a relay computation graph(calls relay.frontend.from_tflite), it returns an error because “filters” of Conv2D op of the origial model was converted to “depth_multiplier” of DepthwiseConv2D op of the TFlite model, which is violating this (assert depth_multiplier == 1).
I tried to convert .h5 --> .tflite and .pb --> .tflite. Both converted “Conv2D (filters=6)” to “DepthwiseConv2D (depth_multiplier=6)”, and it causes an error when executing relay.frontend.from_tflite.