From 620ac206cfc56aa4e8df70220a3da4f25c2fe091 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sun, 4 Aug 2019 13:11:59 -0500 Subject: [PATCH] cleaned up imports for examples --- .../new_project_templates/multi_node_cluster_template.py | 3 --- .../examples/new_project_templates/single_cpu_template.py | 6 +----- .../new_project_templates/single_gpu_node_16bit_template.py | 6 +----- .../new_project_templates/single_gpu_node_dp_template.py | 6 +----- .../new_project_templates/single_gpu_node_template.py | 5 +---- .../examples/new_project_templates/single_gpu_template.py | 5 +---- .../examples/new_project_templates/trainer_cpu_template.py | 4 ++-- 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py b/pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py index 1c226f2f85..1d7bbe246e 100644 --- a/pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py +++ b/pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py @@ -1,13 +1,10 @@ import os -import sys import numpy as np from time import sleep import torch from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args - from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint SEED = 2334 diff --git a/pytorch_lightning/examples/new_project_templates/single_cpu_template.py b/pytorch_lightning/examples/new_project_templates/single_cpu_template.py index 055a489f3e..da449ab4f7 100644 --- a/pytorch_lightning/examples/new_project_templates/single_cpu_template.py +++ b/pytorch_lightning/examples/new_project_templates/single_cpu_template.py @@ -2,15 +2,11 @@ Runs a model on a single node across N-gpus. """ import os -import sys import numpy as np -from time import sleep import torch -from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster +from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args - from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint SEED = 2334 diff --git a/pytorch_lightning/examples/new_project_templates/single_gpu_node_16bit_template.py b/pytorch_lightning/examples/new_project_templates/single_gpu_node_16bit_template.py index b6485aa902..1f2d5d3fab 100644 --- a/pytorch_lightning/examples/new_project_templates/single_gpu_node_16bit_template.py +++ b/pytorch_lightning/examples/new_project_templates/single_gpu_node_16bit_template.py @@ -2,15 +2,11 @@ Runs a model on a single node across N-gpus. """ import os -import sys import numpy as np -from time import sleep import torch -from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster +from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args - from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint SEED = 2334 diff --git a/pytorch_lightning/examples/new_project_templates/single_gpu_node_dp_template.py b/pytorch_lightning/examples/new_project_templates/single_gpu_node_dp_template.py index 34dc444124..6eb66f6b43 100644 --- a/pytorch_lightning/examples/new_project_templates/single_gpu_node_dp_template.py +++ b/pytorch_lightning/examples/new_project_templates/single_gpu_node_dp_template.py @@ -2,15 +2,11 @@ Runs a model on a single node across N-gpus. """ import os -import sys import numpy as np -from time import sleep import torch -from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster +from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args - from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint SEED = 2334 diff --git a/pytorch_lightning/examples/new_project_templates/single_gpu_node_template.py b/pytorch_lightning/examples/new_project_templates/single_gpu_node_template.py index 34dc444124..2855165163 100644 --- a/pytorch_lightning/examples/new_project_templates/single_gpu_node_template.py +++ b/pytorch_lightning/examples/new_project_templates/single_gpu_node_template.py @@ -2,14 +2,11 @@ Runs a model on a single node across N-gpus. """ import os -import sys import numpy as np -from time import sleep import torch -from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster +from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint diff --git a/pytorch_lightning/examples/new_project_templates/single_gpu_template.py b/pytorch_lightning/examples/new_project_templates/single_gpu_template.py index 66714230ca..902c0bc98b 100644 --- a/pytorch_lightning/examples/new_project_templates/single_gpu_template.py +++ b/pytorch_lightning/examples/new_project_templates/single_gpu_template.py @@ -2,14 +2,11 @@ Runs a model on a single node across N-gpus. """ import os -import sys import numpy as np -from time import sleep import torch -from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster +from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer -from pytorch_lightning.utils.arg_parse import add_default_args from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint diff --git a/pytorch_lightning/examples/new_project_templates/trainer_cpu_template.py b/pytorch_lightning/examples/new_project_templates/trainer_cpu_template.py index 434dbb925c..c1b9496d68 100644 --- a/pytorch_lightning/examples/new_project_templates/trainer_cpu_template.py +++ b/pytorch_lightning/examples/new_project_templates/trainer_cpu_template.py @@ -5,7 +5,7 @@ from test_tube import HyperOptArgumentParser, Experiment from pytorch_lightning.models.trainer import Trainer from pytorch_lightning.utils.arg_parse import add_default_args from pytorch_lightning.callbacks.pt_callbacks import EarlyStopping, ModelCheckpoint -from docs.source.examples.example_model import ExampleModel +from lightning_module_template import LightningTemplateModel def main(hparams): @@ -28,7 +28,7 @@ def main(hparams): exp.save() # build model - model = ExampleModel(hparams) + model = LightningTemplateModel(hparams) # callbacks early_stop = EarlyStopping(