Open Evil1m opened 1 year ago
@Evil1m This problem is a bit complicated and not so easy to deal with. I am thinking about it, thanks for the feedback
Hi, any feedback on this issue? I also have the same issue combining two datasets with one class each. It works when I set num_classes = 1
, but that leaves my model with one class? If I set num_classes = 2
I also get the same IndexError.
dota_val_dict=dict( type='CocoDataset', ann_file='ann_path/val_ann.json', img_prefix=img_prefix/images/', pipeline=test_pipeline
)
Ok, I seemed to have found my issue - when concatenating the two dataset validation splits I needed to make sure both categories were listed in the val.json file for each dataset, even though the dataset does not include the class, for example:
"categories": [
{
"id": 0,
"name": "Class from dataset A"
},
{
"id": 1,
"name": "Class from dataset B"
}
],
...
Prerequisite
🐞 Describe the bug
I got 2 dataset Dataset_A have 15 classes with COCO format Dataset_B have 20 classes with VOC format
I followed the format in https://mmdetection.readthedocs.io/en/latest/tutorials/customize_dataset.html#concatenate-dataset note part to create a concated dataset and the config like this:
I try to train this concat in a normal faster rcnn r50 fpn network. so i set the num_classes to a+b which is 35 here![emobile_2022-09-27_15-16-00](https://user-images.githubusercontent.com/17230723/192459095-046f43f8-3fcb-439a-843b-e4c3d4f6875b.png)
then i change both /mmdet/datasets/coco.py and /mmdet/datasets/voc.py file CLASSES part to
which also num = 35
CASE1: when I started training, everything was normal ,but i will got issue when this 1st training process and the 1st val process finished.
list out of range here
CASE2: so I change the faster rcnn r50 fpn num_classes to 15 which equal to dataset_a class num at the same time i change the /mmdet/dataset/coco.py CLASSES part to only include dataset_A classes and the /mmdet/dataset/voc.py CLASSES part to only include dataset_B classes
but i still got issue
CASE3: SO I TRY LIKE THIS WAY and this num_classes still 35
IT SHOWS THE SAME PROBLEM AT CASE1
I really wonder how to correctly concat two different types of datasets for normal training, val and testing processes and another question is : it seem that i can not val and test this two different types datasets together after each epoch finished use the config below:
Environment
fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). sys.platform: linux Python: 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] CUDA available: True GPU 0,2,3,4,6,7: TITAN RTX GPU 1,5: Tesla P40 CUDA_HOME: :/usr/local/cuda-10.2 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~19.10) 7.5.0 PyTorch: 1.10.0+cu102 PyTorch compiling details: PyTorch built with:
TorchVision: 0.11.1+cu102 OpenCV: 4.5.4 MMCV: 1.4.0 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 10.2 MMDetection: 2.19.0+
Additional information
No response