ModelTC / MQBench

Model Quantization Benchmark
Apache License 2.0
767 stars 140 forks source link

lsq 训练量化error: name 'grad_factor' is not defined #239

Closed wangshankun closed 1 year ago

wangshankun commented 1 year ago

name 'grad_factor' is not defined

image

这份代码不论is_tracing_state是否为true都会报错

              if is_tracing_state():
                    X = FakeQuantizeLearnablePerchannelAffine.apply(
                        X, self.scale, self.zero_point, self.ch_axis,
                        self.quant_min, self.quant_max, grad_factor)
                else:
                    X = _fake_quantize_learnable_per_channel_affine_training(
                        X, self.scale, self.zero_point, self.ch_axis,
                        self.quant_min, self.quant_max, grad_factor)
wimh966 commented 1 year ago

您好,按理不会报这个错,在调用grad_factor之前grad_factor都被定义了。 可否提供进一步的错误信息

github-actions[bot] commented 1 year ago

This issue has not received any updates in 120 days. Please reply to this issue if this still unresolved!