many small improvements

This commit is contained in:
hobogalaxy committed 2020-11-29 16:04:00 +01:00
1 parent 8d55f151bd
commit ad0344d0a1
11 files changed
+90 -76

No files matched your search

Whitespace-only changes.
@@ -9,12 +9,13 @@ from models.example_model.models import *
class LitModel(pl.LightningModule):
"""
This is example of lightning model.
The folder name of LitModel used during trainig should be specified in run config and all parameters from
It should always be located in file named 'lightninig_module.py' and always be named 'LitModel'!
The folder name of 'LitModel' used during training should be specified in run config and all parameters from
'model' section will be passed in 'hparams' dictionary.
It enables you to specify what happens during training, validation and test step.
You can just remove validatin_step() or test_step() if you don't want to use them during trainig and model
should still train correctly.
You can just remove 'validation_step()' or 'test_step()' methods if you don't want to have them during training.
See 'simple_mnist_classifier' for more proper example.
"""
@@ -1,4 +1,4 @@
num_of_gpus: -1
num_of_gpus: 0
resume_training:
lightning_ckpt:
File renamed without changes.
+2 -2
View File
@@ -83,8 +83,8 @@ def load_config(path):
def main(run_config_name):
# Load configs
project_config = load_config("project_config.yml")
run_config = load_config("run_configs.yml")[run_config_name]
project_config = load_config("project_config.yaml")
run_config = load_config("run_configs.yaml")[run_config_name]
# Train model
train(project_config=project_config, run_config=run_config)
+2 -2
View File
@@ -137,8 +137,8 @@ class SaveCodeToWandbCallback(pl.Callback):
"utils/callbacks.py",
"utils/init_utils.py",
"train.py",
"project_config.yml",
"run_configs.yml",
"project_config.yaml",
"run_configs.yaml",
]
self.model_path = os.path.dirname(inspect.getfile(lit_model.__class__))
self.datamodule_path = os.path.dirname(inspect.getfile(datamodule.__class__))
+2 -2
View File
@@ -8,8 +8,8 @@ import train
RUN_CONFIG_NAME = "MNIST_CLASSIFIER_V1"
# Load configs
project_config = train.load_config("../project_config.yml")
run_config = train.load_config("../run_configs.yml")[RUN_CONFIG_NAME]
project_config = train.load_config("../project_config.yaml")
run_config = train.load_config("../run_configs.yaml")[RUN_CONFIG_NAME]
# Initialize wandb
wandb.init()
+3 -1
View File
@@ -1,7 +1,9 @@
from models.simple_mnist_classifier.lightning_module import LitModel
from data_modules.mnist_digits_datamodule import transforms
from PIL import Image
# the LitModel you import should be the same as the one you used for training!
from models.simple_mnist_classifier.lightning_module import LitModel
def predict():
"""