From d762e8730869fa746c2430d582e2da2bee890c8e Mon Sep 17 00:00:00 2001 From: Alessandro Cerioni Date: Fri, 8 Sep 2023 13:42:23 +0000 Subject: [PATCH] Comment/delete unused code --- scripts/train_model.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/train_model.py b/scripts/train_model.py index 9e2ac37..960d257 100644 --- a/scripts/train_model.py +++ b/scripts/train_model.py @@ -49,10 +49,11 @@ def main(cfg_file_path): else: MODEL_ZOO_CHECKPOINT_URL = None - if 'pth_file' in cfg['model_weights'].keys(): - MODEL_PTH_FILE = cfg['model_weights']['pth_file'] - else: - MODEL_PTH_FILE = None + # TODO: allow resuming from previous training + # if 'pth_file' in cfg['model_weights'].keys(): + # MODEL_PTH_FILE = cfg['model_weights']['pth_file'] + # else: + # MODEL_PTH_FILE = None if MODEL_ZOO_CHECKPOINT_URL == None: logger.critical("A model zoo checkpoint URL (\"model_zoo_checkpoint_url\") must be provided") @@ -72,9 +73,9 @@ def main(cfg_file_path): os.chdir(WORKING_DIR) # let's make the output directories in case they don't exist - for DIR in [SAMPLE_TAGGED_IMG_SUBDIR, LOG_SUBDIR]: - if not os.path.exists(DIR): - os.makedirs(DIR) + for dir in [SAMPLE_TAGGED_IMG_SUBDIR, LOG_SUBDIR]: + if not os.path.exists(dir): + os.makedirs(dir) @@ -88,10 +89,6 @@ def main(cfg_file_path): registered_datasets = ['trn_dataset', 'val_dataset', 'tst_dataset'] - - registered_datasets_prefixes = [x.split('_')[0] for x in registered_datasets] - - for dataset in registered_datasets: for d in DatasetCatalog.get(dataset)[0:min(len(DatasetCatalog.get(dataset)), 4)]: