open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.21k stars 9.4k forks source link

[Reimplementation] #9816

Open FengRongYue opened 1 year ago

FengRongYue commented 1 year ago

Prerequisite

💬 Describe the reimplementation questions

  1. 我通过继承的方式写了一个centernet的配置文件,但是训练起来后总是报类似于AssertionError: The num_classes (3) in DeformableDETRHead of MMDataParallel does not matches the length of CLASSES 80) in CocoDataset这样的错误。我尝试修改 mmdet/datasets/coco.py 下的CoCoDataset和mmdet/core/evaluation/class_names.py下的coco_classes()这个问题不再出现。我觉的改源码应该不是一个好的解决办法,那么应该怎么办? 这是我用的配置文件 centernet_resnet18_dcnv2_140e_coco.zip

  2. 我的训练时间非常长,我只是训练常见的模型如fasterrcnn和centernet,但是耗费的时间是两天和一天,不知道怎么解决。 image

Environment

sys.platform: linux Python: 3.8.10 (default, Jun 4 2021, 15:09:15) [GCC 7.5.0] CUDA available: True GPU 0: NVIDIA GeForce RTX 3090 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.3, V11.3.109 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 PyTorch: 1.11.0+cu113 PyTorch compiling details: PyTorch built with:

TorchVision: 0.12.0+cu113 OpenCV: 4.6.0 MMCV: 1.7.1 MMCV Compiler: GCC 9.3 MMCV CUDA Compiler: 11.3 MMDetection: 2.28.1+c14dd6c root@autodl-container-995011b452-9370f589:~/autodl-tmp/mubiaojiance/mmdetection/mmdet#

Expected results

No response

Additional information

1.我使用了自己的配置文件,文件在上面给出来了。 2.我使用的是自己的数据集,数据集已经按照COCO格式处理了。

FengRongYue commented 1 year ago

上面Describe the reimplementation questions 里面的配置文件是我所继承的配置文件,我使用的配置文件是 AGAR_config.zip

ZwwWayne commented 1 year ago

You should also modify the dataset class, to make its number of classes to be 3. You can simple pass classes to the dataset

FengRongYue commented 1 year ago

You should also modify the dataset class, to make its number of classes to be 3. You can simple pass classes to the dataset

我试了,有用,谢谢。 我还有一个问题,我训练很慢该从哪方面找问题呢?我的数据集也不是很大5000张4000*4000的图片 image