Skip to content

Commit

Permalink
Update train.py to compat with new config
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Oct 11, 2023
1 parent b0a792e commit 4849324
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ def merge_args(cfg, args):

# enable automatic-mixed-precision training
if args.amp is True:
optim_wrapper = cfg.optim_wrapper.get('type', 'OptimWrapper')
assert optim_wrapper in ['OptimWrapper', 'AmpOptimWrapper'], \
'`--amp` is not supported custom optimizer wrapper type ' \
f'`{optim_wrapper}.'
cfg.optim_wrapper.type = 'AmpOptimWrapper'
cfg.optim_wrapper.setdefault('loss_scale', 'dynamic')

Expand Down

0 comments on commit 4849324

Please sign in to comment.