Skip to content

Commit 6803018

Browse files
TheStoneMXwilliamFalcon
authored andcommitted
changed hard coded paramater, and moved it to parent_parser (#238)
* changed hard coded paramater, and moved it to parent_parser ```python # ------------------------ # 4 INIT TRAINER # ------------------------ trainer = Trainer( experiment=exp, checkpoint_callback=checkpoint, early_stop_callback=early_stop, gpus=hparams.gpus, distributed_backend=hparams.dist_bak_end ) parent_parser.add_argument('--dist_bak_end', type=str, default='ddp', help='When using multiple GPUs set Trainer(distributed_backend=dp) (or ddp)') ``` * Update single_gpu_node_ddp_template.py
1 parent 8770815 commit 6803018

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/new_project_templates/single_gpu_node_ddp_template.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main(hparams):
7171
checkpoint_callback=checkpoint,
7272
early_stop_callback=early_stop,
7373
gpus=hparams.gpus,
74-
distributed_backend='ddp'
74+
distributed_backend=hparams.dist_backend
7575
)
7676

7777
# ------------------------
@@ -95,6 +95,8 @@ def main(hparams):
9595
parent_parser.add_argument('--gpus', type=str, default='-1',
9696
help='how many gpus to use in the node.'
9797
' value -1 uses all the gpus on the node')
98+
parent_parser.add_argument('--dist_backend', type=str, default='ddp',
99+
help='When using multiple GPUs set Trainer(distributed_backend=dp) (or ddp)')
98100
parent_parser.add_argument('--test_tube_save_path', type=str, default=test_tube_dir,
99101
help='where to save logs')
100102
parent_parser.add_argument('--model_save_path', type=str, default=checkpoint_dir,

0 commit comments

Comments
 (0)