Merge pull request #1645 from danpcampbell/bugfix/1637_slurm-fix

Only call load_spawn_weights if COLAB_GPU or KAGGLE_URL_BASE
This commit is contained in:
William Falcon
2020-04-27 20:08:06 -04:00
committed by GitHub
+3 -2
View File
@@ -750,8 +750,9 @@ class Trainer(
# train
mp.spawn(self.ddp_train, nprocs=self.num_processes, args=(model,))
# load weights if not interrupted
self.load_spawn_weights(model)
self.model = model
if os.getenv('COLAB_GPU') or os.getenv('KAGGLE_URL_BASE'):
self.load_spawn_weights(model)
self.model = model
# 1 gpu or dp option triggers training using DP module
# easier to avoid NCCL issues