From 4a879fee8baf5c95aac1fe1ae0a33253ab2d6399 Mon Sep 17 00:00:00 2001 From: sjleo1 Date: Mon, 28 Nov 2022 01:16:52 +0000 Subject: [PATCH] :bug: Fix `cfg.model.roi_head.bbox.num_classes` on `train.py` --- mmdetection/tools/train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmdetection/tools/train.py b/mmdetection/tools/train.py index 7d5df0f..3c7f04f 100644 --- a/mmdetection/tools/train.py +++ b/mmdetection/tools/train.py @@ -205,7 +205,8 @@ def main(): logger = get_root_logger(log_file=log_file, log_level=cfg.log_level) # set num_classes - cfg.model.roi_head.bbox_head.num_classes = len(cfg.classes) + for bbox_head in cfg.model.roi_head.bbox_head: + bbox_head.num_classes = len(cfg.classes) # init the meta dict to record some important information such as # environment info and seed, which will be logged