facebookresearch / adaptive_teacher

This repo provides the source code for "Cross-Domain Adaptive Teacher for Object Detection".
Other
180 stars 35 forks source link

Can not reproduce the results of "cityscapes" to "foggy cityscapes". #24

Open cwhgn opened 2 years ago

cwhgn commented 2 years ago

Hi,I get some problems during the reproduction of the results of "cityscapes" to "foggy cityscapes".

During my reproduction, I caught an error as below: img1

The environment is followed by your prerequisites: detectron=0.3, pytorch=1.7, cuda=11.0, python=3.7. So I changed your code in below to solve the error:

From https://github.com/facebookresearch/adaptive_teacher/blob/cba3c59cadfc9f1a3a676a82bf63d76579ab552b/adapteacher/engine/trainer.py#L167-L168 to evaluator_list.append(COCOEvaluator(dataset_name, cfg, True, output_dir=output_folder))

This error is solved after my modification. Is this modification OK? However, besides this error, another error arise when I run 32979 iterations, shown as below. img2

I have changed the IMG_PER_BATCH_LABEL/IMG_PER_BATCH_UNLABEL to 8/8. But the error is still there. My GPU is 16G V100 and Memory is 377G. Due to this error, I can not reproduce the results of "cityscapes" to "foggy cityscapes". Do you know how to fix this error?

yujheli commented 2 years ago

I did not get this error. When you look into the class COCOEvaluator, these two parameters are not supposed to be required:

image
cwhgn commented 2 years ago

Did you use the wrong version of Detectron2? The COCOEvaluator in Detectron2=0.3 is as below: image

cwhgn commented 2 years ago

I've changed my Detectron2 from v0.3 to v0.5. The code can be well run. But the performance is much lower than the reported, as below (city to foggy). It's hard for me to find the reason, as I do not changed anything in codes. Do you have any log files for me to find the problem? image

cwhgn commented 2 years ago

Here is my config.yml:

CUDNN_BENCHMARK: false DATALOADER: ASPECT_RATIO_GROUPING: true FILTER_EMPTY_ANNOTATIONS: true NUM_WORKERS: 4 RANDOM_DATA_SEED: 0 RANDOM_DATA_SEED_PATH: dataseed/COCO_supervision.txt REPEAT_THRESHOLD: 0.0 SAMPLER_TRAIN: TrainingSampler SUP_PERCENT: 100.0 DATASETS: CROSS_DATASET: true PRECOMPUTED_PROPOSAL_TOPK_TEST: 1000 PRECOMPUTED_PROPOSAL_TOPK_TRAIN: 2000 PROPOSAL_FILES_TEST: [] PROPOSAL_FILES_TRAIN: [] TEST:

cwhgn commented 2 years ago

By the way, when I run the code on city to foggy, the dataset information is listed as below. Do it the same with yours? image

When I run the code on pascal voc to clipart, an error is received. I do not change any code, but set the dataset directory as you required. I get the clipart from (https://github.com/naoto0804/cross-domain-detection/tree/master/datasets), do I need to do some modification before running the code? Do you know how to fix it? image image

yujheli commented 2 years ago

@cwhgn check if comment this line works for you for the clipart? https://github.com/facebookresearch/adaptive_teacher/blob/main/adapteacher/data/dataset_mapper.py#L83

cwhgn commented 2 years ago

@cwhgn check if comment this line works for you for the clipart? https://github.com/facebookresearch/adaptive_teacher/blob/main/adapteacher/data/dataset_mapper.py#L83

Thanks, it works. By the way, can you give me some help on the low performance problem of city-to-foggy I reproduced above?

yujheli commented 2 years ago

@cwhgn Are you looking at AP50 instead of AP? For AP50 of each class, please find it in the tensorboard.

cwhgn commented 2 years ago

@cwhgn Are you looking at AP50 instead of AP? For AP50 of each class, please find it in the tensorboard.

Thanks, it's a great help for me! Another question, how to fix this problem that arises during my training on pascal voc to clipart. image

yujheli commented 2 years ago

@cwhgn see https://github.com/facebookresearch/adaptive_teacher/issues/25

onkarkris commented 2 years ago

I've changed my Detectron2 from v0.3 to v0.5. The code can be well run. But the performance is much lower than the reported, as below (city to foggy). It's hard for me to find the reason, as I do not changed anything in codes. Do you have any log files for me to find the problem? image

@cwhgn I am unable to reproduce results on smaller batch size (4) on 4 GPUs, did you try with with less GPUs? I can get around 41 AP@50

yujheli commented 1 year ago

For those who asked to reproduce the foggy cityscapes, I attached the parameters swift: image

The best result requires the specific parameter while I'm still figuring out the difficulty.