[Solved] How to quantize the weights in parameters?


#1

It looks like relay.quantize.quantize only return a quantized graph, but leave the parameter untouched?

net = relay.quantize.quantize(net, params=params)

How could we get the quantized weights? Thanks!


#2

The quantized params will be bind to the quantized model. They will become constants in net


#3

Thanks for replying. How could I persist the quantized params and load it later? Thanks!


#4

#5

net = relay.quantize.quantize(net, params=params)

The problem is params was not touched, and still remained in float32 type. :frowning:


#6

graph, lib, params = relay.build(net)

Then you can obtain updated params


#7

@vinx13 Oh, I see, I should not pass params in relay.build for a quantized model. Thanks so much