fixed correct module on hpc save

This commit is contained in:
William Falcon
2019-07-24 18:16:02 -04:00
parent 7217ecdb18
commit d7be0aae1c
2 changed files with 8 additions and 0 deletions
@@ -42,6 +42,7 @@ class ModelIO(object):
class TrainerIO(object):
def __get_model(self):
print(type(self.model))
is_dp_module = type(self.model) is LightningDistributedDataParallel or type(self.model) is LightningDataParallel
model = self.model.module if is_dp_module else self.model
return model
+7
View File
@@ -36,4 +36,11 @@ This file fits a tiny model on MNIST using these different set-ups.
3. Multiple (2) GPUs using DP + apex (for 16-bit precision).
3. Multiple (2) GPUs using DDP + apex (for 16-bit precision).
For each set up it also tests:
1. model saving.
2. model loading.
3. predicting with a loaded model.
4. simulated save from HPC signal.
5. simulated load from HPC signal.