!7972 Fix batchnorm infer

Merge pull request !7972 from VectorSL/master
This commit is contained in:
mindspore-ci-bot 2020-10-30 18:08:55 +08:00 committed by Gitee
commit 9b6530e3b3
2 changed files with 2 additions and 2 deletions

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)

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) | |