浏览代码

!7972 Fix batchnorm infer

Merge pull request !7972 from VectorSL/master
tags/v1.1.0
mindspore-ci-bot Gitee 5 年前
父节点
当前提交
9b6530e3b3
共有 2 个文件被更改,包括 2 次插入2 次删除
  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 查看文件

@@ -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 查看文件

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


正在加载...
取消
保存