Browse Source

!6178 [VM][Quant]fix bug of convert to quantative network of parameter has_bias

Merge pull request !6178 from chenfei_mindspore/master
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
c9545b1b78
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      mindspore/train/quant/quant.py

+ 6
- 2
mindspore/train/quant/quant.py View File

@@ -187,7 +187,9 @@ class ConvertToQuantNetwork:
num_bits=self.weight_bits,
fake=True,
symmetric=self.weight_symmetric,
narrow_range=self.weight_range)
narrow_range=self.weight_range,
has_bias=conv_inner.has_bias,
bias_init=conv_inner.bias_init)
# change original network BatchNormal OP parameters to quant network
conv_inner.gamma = subcell.batchnorm.gamma
conv_inner.beta = subcell.batchnorm.beta
@@ -212,7 +214,9 @@ class ConvertToQuantNetwork:
per_channel=self.weight_channel,
num_bits=self.weight_bits,
symmetric=self.weight_symmetric,
narrow_range=self.weight_range)
narrow_range=self.weight_range,
has_bias=conv_inner.has_bias,
bias_init=conv_inner.bias_init)
# change original network BatchNormal OP parameters to quant network
conv_inner.batchnorm.gamma = subcell.batchnorm.gamma
conv_inner.batchnorm.beta = subcell.batchnorm.beta


Loading…
Cancel
Save