!7155 fix resnext50 gpu amp

Merge pull request !7155 from zhaoting/master
This commit is contained in:
mindspore-ci-bot 2020-10-10 19:25:28 +08:00 committed by Gitee
commit 1d7c759cea
1 changed files with 2 additions and 6 deletions

View File

@ -240,12 +240,8 @@ def train(cloud_args=None):
else:
loss_scale_manager = FixedLossScaleManager(args.loss_scale, drop_overflow_update=False)
if args.platform == "Ascend":
model = Model(network, loss_fn=loss, optimizer=opt, loss_scale_manager=loss_scale_manager,
metrics={'acc'}, amp_level="O3")
else:
model = Model(network, loss_fn=loss, optimizer=opt, loss_scale_manager=loss_scale_manager,
metrics={'acc'}, amp_level="O2")
model = Model(network, loss_fn=loss, optimizer=opt, loss_scale_manager=loss_scale_manager,
metrics={'acc'}, amp_level="O3")
# checkpoint save
progress_cb = ProgressMonitor(args)