Browse Source

fix gpu batchnorm infer

tags/v1.1.0
VectorSL 5 years ago
parent
commit
423b4ef926
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/nn/layer/normalization.py
  2. +1
    -1
      model_zoo/official/cv/resnet/README.md

+ 1
- 1
mindspore/nn/layer/normalization.py View File

@@ -108,7 +108,7 @@ class _BatchNorm(Cell):
self.bn_train = P.FusedBatchNorm(mode=1,
epsilon=self.eps,
momentum=self.momentum)
self.bn_infer = P.BatchNorm(is_training=False, epsilon=self.eps)
self.bn_infer = P.BatchNorm(is_training=False, epsilon=self.eps, data_format=self.format)
self.enable_global_sync = self.is_global and (self.is_ge_backend or (self.is_graph_mode and self.is_ascend))
self.enable_default_train = self.is_graph_mode and not self.is_global and \
(self.is_ge_backend or self.is_ascend)


+ 1
- 1
model_zoo/official/cv/resnet/README.md View File

@@ -513,7 +513,7 @@ result: {'top_5_accuracy': 0.9342589628681178, 'top_1_accuracy': 0.7680657810499
| Uploaded Date | 04/01/2020 (month/day/year) | 08/01/2020 (month/day/year) |
| MindSpore Version | 0.1.0-alpha | 0.6.0-alpha |
| Dataset | ImageNet2012 | ImageNet2012 |
| batch_size | 256 | 32 |
| batch_size | 256 | 256 |
| outputs | probability | probability |
| Accuracy | 76.70% | 76.74% |
| Model for inference | 98M (.air file) | |


Loading…
Cancel
Save