diff --git a/imperative/python/megengine/module/quantized/conv_bn.py b/imperative/python/megengine/module/quantized/conv_bn.py index 4b3b5772b65988135d10e1056366d63be98d0669..2bfc070a49c4c250613e606f70c78e05972ee5dc 100644 --- a/imperative/python/megengine/module/quantized/conv_bn.py +++ b/imperative/python/megengine/module/quantized/conv_bn.py @@ -40,7 +40,9 @@ class _ConvBnActivation2d(Conv2d): ) weight = w_fold.astype(qat_module.get_weight_dtype()) qconv.weight = Parameter(weight.numpy(), name=qat_module.conv.weight.name) - qconv.bias = Parameter(b_fold.numpy(), name=qat_module.conv.bias.name) + qconv.bias = Parameter(b_fold.numpy()) + if qat_module.conv.bias is not None: + qconv.bias.name = qat_module.conv.bias.name return qconv