Closed Williamlizl closed 2 years ago
Can you provide more details? If you run with your dataset, you need to change the num_classes. https://github.com/Sense-X/UniFormer/blob/57b9086c9b54b144a9ba55d4247e2ed92d894011/object_detection/configs/_base_/models/mask_rcnn_uniformer_fpn.py#L48
Can you provide more details? If you run with your dataset, you need to change the num_classes.
I have changed the num_class in the config py、\mmdet\datasets\coco.py、\mmdet\core\evaluation\class_names.py,
then I run python3.7 setup.py install
, it still shows the error
54 is the number of classes for your dataset? I guess you don't change the config correctly.
You can check the generated file (xxx.log
) for training, and find whether you have already changed the num_class
.
Can you provide the config that you run?
Traceback (most recent call last): File "./tools/train.py", line 187, in <module> main() File "./tools/train.py", line 183, in main meta=meta) File "/home/lbc/UniFormer/object_detection/mmdet/apis/train.py", line 185, in train_detector runner.run(data_loaders, cfg.workflow) File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run epoch_runner(data_loaders[i], **kwargs) File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 45, in train self.call_hook('before_train_epoch') File "/home/lbc/.local/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 307, in call_hook getattr(hook, fn_name)(self) File "/home/lbc/UniFormer/object_detection/mmdet/datasets/utils.py", line 150, in before_train_epoch self._check_head(runner) File "/home/lbc/UniFormer/object_detection/mmdet/datasets/utils.py", line 137, in _check_head (f'The
num_classes` ({module.num_classes}) in '2022-02-23 16:06:53,711 - mmdet - INFO - Checkpoints will be saved to /home/lbc/UniFormer/object_detection/work_dirs/config by HardDiskBackend.
AssertionError: The num_classes
(54) in ConvFCBBoxHead of MMDistributedDataParallel does not matches the length of CLASSES
80) in CocoDataset`
54 is the number of classes for your dataset? I guess you don't change the config correctly. You can check the generated file (
xxx.log
) for training, and find whether you have already changed thenum_class
. Can you provide the config that you run?
I check the log file, it does show the num_class=54, could you tell me which mmdetection edition you have used?
@Williamlizl You can find the version in version.py. It is 2.11.0.
You can install the mmdet under our repo => UniFormer/object_detection/
Moreover, could you share the detailed config
and shell
you run? Maybe you can open new repo and upload the config you use. I will check it.
Moreover, could you share the detailed
config
andshell
you run? Maybe you can open new repo and upload the config you use. I will check it.
Ok ,thank u
AssertionError: The
num_classes(80) in UniFormer of MMDistributedDataParallel does not matches the length of
CLASSES54) in CocoDataset