forked from mindspore-Ecosystem/mindspore
!16952 enable graph_kernel while train inceptionv3 on gpu
From: @yiyanzhi_akane Reviewed-by: @anyrenwei,@ckey_dou Signed-off-by: @ckey_dou
This commit is contained in:
commit
293eb7bb01
|
@ -60,6 +60,9 @@ if __name__ == '__main__':
|
||||||
cfg = CFG_DICT[args_opt.platform]
|
cfg = CFG_DICT[args_opt.platform]
|
||||||
create_dataset = DS_DICT[cfg.ds_type]
|
create_dataset = DS_DICT[cfg.ds_type]
|
||||||
|
|
||||||
|
if args_opt.platform == "GPU":
|
||||||
|
context.set_context(enable_graph_kernel=True)
|
||||||
|
|
||||||
context.set_context(mode=context.GRAPH_MODE, device_target=args_opt.platform, save_graphs=False)
|
context.set_context(mode=context.GRAPH_MODE, device_target=args_opt.platform, save_graphs=False)
|
||||||
if os.getenv('DEVICE_ID', "not_set").isdigit():
|
if os.getenv('DEVICE_ID', "not_set").isdigit():
|
||||||
context.set_context(device_id=int(os.getenv('DEVICE_ID')))
|
context.set_context(device_id=int(os.getenv('DEVICE_ID')))
|
||||||
|
|
Loading…
Reference in New Issue