Browse Source

fix mobilnetv1 1p error: device_id not defined

pull/15677/head
chenhaozhe 4 years ago
parent
commit
9efc2e4eb2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      model_zoo/official/cv/mobilenetv1/train.py

+ 1
- 1
model_zoo/official/cv/mobilenetv1/train.py View File

@@ -61,9 +61,9 @@ if __name__ == '__main__':
context.set_context(mode=context.GRAPH_MODE, device_target=target, save_graphs=False)
if args_opt.parameter_server:
context.set_ps_context(enable_ps=True)
device_id = int(os.getenv('DEVICE_ID'), '0')
if args_opt.run_distribute:
if target == "Ascend":
device_id = int(os.getenv('DEVICE_ID'))
context.set_context(device_id=device_id, enable_auto_mixed_precision=True)
context.set_auto_parallel_context(device_num=args_opt.device_num, parallel_mode=ParallelMode.DATA_PARALLEL,
gradients_mean=True)


Loading…
Cancel
Save