From 03ef46b1589950bcd6be290776edf8521230a109 Mon Sep 17 00:00:00 2001 From: hobogalaxy Date: Mon, 16 Nov 2020 20:49:38 +0100 Subject: [PATCH] some quick refactoring --- README.md | 2 +- project/pipeline_modules/callbacks.py | 4 ++-- project/train.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70eaf67..96d5aae 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ https://pytorch.org/get-started/locally/ pip install -r requirements.txt ``` -### PyCharm set up +### PyCharm setup - open this repository as PyCharm project - set "hack_env" as project interpreter:
`Ctrl + Shift + A -> type "Project Interpreter"` diff --git a/project/pipeline_modules/callbacks.py b/project/pipeline_modules/callbacks.py index ad06da3..6bf1e48 100644 --- a/project/pipeline_modules/callbacks.py +++ b/project/pipeline_modules/callbacks.py @@ -18,7 +18,7 @@ class ExampleCallback(Callback): print('Do something when training ends.') -class SaveOnnxToWandbCallback(Callback): +class SaveModelOnnxCallback(Callback): """Save model in .onnx format.""" def __init__(self, datamodule, save_dir): first_batch = next(iter(datamodule.train_dataloader())) @@ -55,7 +55,7 @@ class ImagePredictionLoggerCallback(Callback): ]}) -class UnFreezeModelCallback(Callback): +class UnfreezeModelCallback(Callback): """Unfreeze model after a few epochs.""" def __init__(self, wait_epochs=5): self.wait_epochs = wait_epochs diff --git a/project/train.py b/project/train.py index e3ff584..d025107 100644 --- a/project/train.py +++ b/project/train.py @@ -40,8 +40,8 @@ def train(config): ), # ExampleCallback(), # ConfusionMatrixLoggerCallback(), - # UnFreezeModelCallback(wait_epochs=5), - # SaveOnnxToWandbCallback(datamodule=datamodule, save_dir=wandb_logger.save_dir) + # UnfreezeModelCallback(wait_epochs=5), + # SaveModelOnnxCallback(datamodule=datamodule, save_dir=wandb_logger.save_dir) ] # Init trainer