From 4860abc78b0976faf2c423713d5b90cfaa55ed22 Mon Sep 17 00:00:00 2001 From: Samet Akcay Date: Tue, 20 Sep 2022 11:01:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20Fix=20category=20check=20for=20f?= =?UTF-8?q?older=20dataset=20in=20anomalib=20CLI=20(#567)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix category check * Fix config file --- anomalib/utils/cli/cli.py | 2 +- configs/model/fastflow.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/anomalib/utils/cli/cli.py b/anomalib/utils/cli/cli.py index 826e98cd46..48c1769163 100644 --- a/anomalib/utils/cli/cli.py +++ b/anomalib/utils/cli/cli.py @@ -144,7 +144,7 @@ def __set_default_root_dir(self) -> None: root_dir = config.trainer.default_root_dir if config.trainer.default_root_dir else "./results" model_name = config.model.class_path.split(".")[-1].lower() data_name = config.data.class_path.split(".")[-1].lower() - category = config.data.init_args.category if config.data.init_args.keys() else "" + category = config.data.init_args.category if "category" in config.data.init_args else "" time_stamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") default_root_dir = os.path.join(root_dir, model_name, data_name, category, time_stamp) diff --git a/configs/model/fastflow.yaml b/configs/model/fastflow.yaml index c63491f4b5..1a2217ab6f 100644 --- a/configs/model/fastflow.yaml +++ b/configs/model/fastflow.yaml @@ -30,7 +30,7 @@ model: hidden_ratio: 1.0 # options: [1.0, 1.0, 0.16, 0.16] - for each supported backbone optimizer: - class_path: torch.optim._multi_tensor.Adam + class_path: torch.optim._multi_tensor.adam.Adam init_args: lr: 0.001 weight_decay: 0.00001