!1167 add o2 amp level to resent50_imagenet2012

Merge pull request !1167 from gengdongjie/master
This commit is contained in:
mindspore-ci-bot 2020-05-15 11:53:53 +08:00 committed by Gitee
commit e2951707f2
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ if __name__ == '__main__':
opt = Momentum(filter(lambda x: x.requires_grad, net.get_parameters()), lr, config.momentum,
config.weight_decay, config.loss_scale)
model = Model(net, loss_fn=loss, optimizer=opt, loss_scale_manager=loss_scale, metrics={'acc'})
model = Model(net, loss_fn=loss, optimizer=opt, loss_scale_manager=loss_scale, metrics={'acc'}, amp_level="O2",
keep_batchnorm_fp32=False)
time_cb = TimeMonitor(data_size=step_size)
loss_cb = LossMonitor()