From 36040b70e43451be5dbc191c9c0a9848a1c9790b Mon Sep 17 00:00:00 2001 From: YuyangXue_Ed Date: Mon, 20 Nov 2023 14:54:02 +0000 Subject: [PATCH] make it to template --- configs/logger/comet.yaml | 2 +- configs/train.yaml | 2 +- setup.py | 8 ++++---- src/data/fastmri_datamodule.py | 3 ++- src/models/mri_module.py | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configs/logger/comet.yaml b/configs/logger/comet.yaml index 3ece1ab..02773b9 100644 --- a/configs/logger/comet.yaml +++ b/configs/logger/comet.yaml @@ -4,7 +4,7 @@ comet: _target_: lightning.pytorch.loggers.comet.CometLogger api_key: ${oc.env:COMET_API_TOKEN} # api key is loaded from environment variable save_dir: "${paths.output_dir}" - project_name: "fastmri_reconstruction_unet" + project_name: "MRI_Recon_fastMRI_Template" rest_api_key: null # experiment_name: "" experiment_key: null # set to resume experiment diff --git a/configs/train.yaml b/configs/train.yaml index 50e4537..83bf654 100644 --- a/configs/train.yaml +++ b/configs/train.yaml @@ -29,7 +29,7 @@ defaults: - debug: null # task name, determines output directory path -task_name: "fastmri_knee_training" +task_name: "MRI_Recon_fastMRI_Template" # tags to help you identify your experiments # you can overwrite this in experiment configs diff --git a/setup.py b/setup.py index f1826cc..4201240 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ setup( name="src", version="0.0.1", - description="Describe Your Cool Project", - author="", - author_email="", - url="https://github.com/user/project", + description="MRI Reconstruction using Lighting and Hydra", + author="Yuyang Xue", + author_email="yuyang.xue@ed.ac.uk", + url="https://github.com/YuyangXueEd/ReconHydra", install_requires=["lightning", "hydra-core"], packages=find_packages(), # use this to customize global commands available in the terminal after installing the package diff --git a/src/data/fastmri_datamodule.py b/src/data/fastmri_datamodule.py index c5a3358..6afd31b 100644 --- a/src/data/fastmri_datamodule.py +++ b/src/data/fastmri_datamodule.py @@ -114,6 +114,7 @@ def __init__( if sample_rate is not None and volume_sample_rate is not None: raise ValueError("Either sample_rate or volume_sample_rate should be set but not both.") + Path("../data/caches/").mkdir(parents=True, exist_ok=True) self.dataset_cache_file = Path('../data/caches/' + dataset_cache_file) self.transform = transform self.recons_key = "reconstruction_rss" if challenge == "multicoil" else "reconstruction_esc" @@ -471,7 +472,7 @@ def __init__( # this line allows to access init params with 'self.hparams' attribute # also ensures init params will be stored in ckpt - self.save_hyperparameters(logger=False) + self.save_hyperparameters(ignore=['net']) self.data_path = Path(data_path) self.challenge = challenge diff --git a/src/models/mri_module.py b/src/models/mri_module.py index 6538663..1c49616 100644 --- a/src/models/mri_module.py +++ b/src/models/mri_module.py @@ -30,7 +30,7 @@ def __init__( # this line allows to access init params with 'self.hparams' attribute # also ensures init params will be stored in ckpt - self.save_hyperparameters(logger=False) + self.save_hyperparameters(ignore=['net']) self.num_log_images = num_log_images