From cc51706a58ea8c671054e68fb4f0d08173603600 Mon Sep 17 00:00:00 2001 From: Gido van de Ven Date: Wed, 23 Nov 2022 11:27:49 +0100 Subject: [PATCH] Fixed error that caused replay to be run incorrectly. --- compare_all.py | 1 + main_cl.py | 13 ------------- options.py | 15 +++++++++++---- options_gen_classifier.py | 4 ++++ preprocess_core50.py | 11 +++++++++-- requirements.txt | 18 +++++++++--------- 6 files changed, 34 insertions(+), 28 deletions(-) diff --git a/compare_all.py b/compare_all.py index cd17f20..dcb24f9 100755 --- a/compare_all.py +++ b/compare_all.py @@ -154,6 +154,7 @@ def collect_all(method_dict, seed_list, args, name=None): AR1 = {} AR1 = collect_all(AR1, seed_list, args, name="AR1") args.cwr = False + args.cwr_plus = False args.si = False args.reg_only_hidden = False diff --git a/main_cl.py b/main_cl.py index 8352902..bbeadb3 100755 --- a/main_cl.py +++ b/main_cl.py @@ -160,19 +160,6 @@ def run(args, verbose=False): test_datasets = new_test_datasets - #-------------------------------------------------------------------------------------------------# - - #-----------------------# - #----- EXPERT GATE -----# - #-----------------------# - - # Define the expert gate - if utils.checkattr(args, 'expert_gate'): - if verbose: - print("\nDefining the expert gate...") - #expert_gate = ... - - #-------------------------------------------------------------------------------------------------# #----------------------# diff --git a/options.py b/options.py index b55c19e..443e398 100644 --- a/options.py +++ b/options.py @@ -1,6 +1,10 @@ import argparse from utils import checkattr +##-------------------------------------------------------------------------------------------------------------------## + +# Where to store the data / results / models / plots +store = "./store" ##-------------------------------------------------------------------------------------------------------------------## @@ -25,11 +29,14 @@ def add_general_options(parser, single_task=False, only_fc=True, **kwargs): parser.add_argument('--get-stamp', action='store_true', help='print param-stamp & exit') parser.add_argument('--seed', type=int, default=0, help='random seed (for each random-module used)') parser.add_argument('--no-gpus', action='store_false', dest='cuda', help="don't use GPUs") - parser.add_argument('--data-dir', type=str, default='./store/datasets', dest='d_dir', help="default: %(default)s") - parser.add_argument('--model-dir', type=str, default='./store/models', dest='m_dir', help="default: %(default)s") + parser.add_argument('--data-dir', type=str, default='{}/datasets'.format(store), dest='d_dir', + help="default: %(default)s") + parser.add_argument('--model-dir', type=str, default='{}/models'.format(store), dest='m_dir', + help="default: %(default)s") if not single_task: - parser.add_argument('--plot-dir', type=str, default='./store/plots', dest='p_dir', help="default: %(default)s") - parser.add_argument('--results-dir', type=str, default='./store/results', dest='r_dir', + parser.add_argument('--plot-dir', type=str, default='{}/plots'.format(store), dest='p_dir', + help="default: %(default)s") + parser.add_argument('--results-dir', type=str, default='{}/results'.format(store), dest='r_dir', help="default: %(default)s") return parser diff --git a/options_gen_classifier.py b/options_gen_classifier.py index bc467b6..b6a38be 100644 --- a/options_gen_classifier.py +++ b/options_gen_classifier.py @@ -1,6 +1,10 @@ import argparse from utils import checkattr +##-------------------------------------------------------------------------------------------------------------------## + +# Where to store the data / results / models / plots +store = "./store" ##-------------------------------------------------------------------------------------------------------------------## diff --git a/preprocess_core50.py b/preprocess_core50.py index 16e1272..4cca2a4 100755 --- a/preprocess_core50.py +++ b/preprocess_core50.py @@ -15,6 +15,12 @@ ## NOTE: The loading of the COR50e-dataset is based on: https://github.com/Continvvm/continuum (retrieved 18 Dec 2020) +##-------------------------------------------------------------------------------------------------------------------## + +# Where to store the data / results / models / plots +store = "./store" + +##-------------------------------------------------------------------------------------------------------------------## #################################################################################################################### @@ -118,14 +124,15 @@ def handle_inputs(): filename = 'preprocess_core50.py' description = 'Download and preprocess (with ResNet18 pretrained on ImageNet) the CORe50 dataset.' parser = argparse.ArgumentParser('./{}.py'.format(filename), description=description) - parser.add_argument('--data-dir', type=str, default='./store/datasets', dest='d_dir', help="default: %(default)s") + parser.add_argument('--data-dir', type=str, default='{}/datasets'.format(store), + dest='d_dir', help="default: %(default)s") parser.add_argument('--batch', type=int, default=512, help="batch-size for pre-processing") args = parser.parse_args() return args ## Function for downloading and pre-processing the CORe50 dataset -def download_and_preprocess(data_dir='./store/datasets', batch_size=512): +def download_and_preprocess(data_dir='{}/datasets'.format(store), batch_size=512): # Create folders, if necessary if not os.path.isdir(data_dir): diff --git a/requirements.txt b/requirements.txt index 73907b7..554d1ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -numpy==1.19.5 -scipy==1.5.4 -pandas==1.1.5 -torch==1.7.1 -torchvision==0.8.2 -tqdm==4.58.0 -scikit-learn==0.24.1 -matplotlib==3.3.4 -visdom==0.1.8.9 \ No newline at end of file +numpy +scipy +pandas +torch +torchvision +tqdm +scikit-learn +matplotlib +visdom \ No newline at end of file