forked from mindspore-Ecosystem/mindspore
!1167 add o2 amp level to resent50_imagenet2012
Merge pull request !1167 from gengdongjie/master
This commit is contained in:
commit
e2951707f2
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue