Hi All,
I tried to quantize the inception model using tvm quantization.
Non-Quantized model accuracy on imagenet validation dataset is 76.1%
Quantized model accuracy on imagenet validation dataset is 15.7%
Below script modification we have done to enable the quantization.
shape_dict = {‘DecodeJpeg/contents’: (299, 299, 3)}
dtype_dict = {‘DecodeJpeg/contents’: ‘uint8’}
mod, params = relay.frontend.from_tensorflow(graph_def,
layout=layout,
shape=shape_dict)
mod = relay.quantize.quantize(mod[‘main’], params)
with relay.build_config(opt_level=3):
graph, lib, params = relay.build(mod,
target=target,
target_host=target_host,
params=params)
m = graph_runtime.create(graph, lib, ctx)
m.set_input(‘DecodeJpeg/contents’, tvm.nd.array(x.astype(dtype)))
m.set_input(**params)
m.run()
Someone please correct me if anything wrong in the script?
Or the current TVM quantization is giving poor accuracy?