Open chan1031 opened 1 week ago
Hi @chan1031 , I guess you need to change the lines in your test_pipeline
, precisely Resize
and LoadAnnotations
.
Call LoadAnnotations
before calling Resize
.
Annotations should also be resized after loading, so you need to first load annotations and then resize them as well. This is why you might be getting 0 mAP after evaluation only. Let us know if it helps.
load @tojimahammatov Thank you for reply I modified the code as you suggested and retrained it, but the mAP value is still coming out as 0.
How about if you remove LoadAnnotations
completely while keeping only Resize
pipeline?
In fact, you don't need LoadAnnotations
in validation and test since annotation file (ann_file
) contains everything.
Describe the bug When using ViT as a backbone in Faster R-CNN, the bbox mAP is always 0 during validation, even though the training loss is decreasing normally. The training shows normal loss values (loss_rpn_cls, loss_rpn_bbox, loss_cls, loss_bbox), but validation results show all zeros for mAP metrics.
Modified the Faster R-CNN config to use ViT as backbone instead of ResNet. The main modifications are: Changed backbone to ViT Adjusted FPN in_channels for ViT output Modified optimizer settings(lr)
Environment 2.Please run
python mmdet/utils/collect_env.py
to collect necessary environment information and paste it here. sys.platform: linux Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0,1: NVIDIA GeForce RTX 3090 CUDA_HOME: /usr/local/cuda-12.1 NVCC: Cuda compilation tools, release 12.1, V12.1.66 GCC: gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0 PyTorch: 2.1.1 PyTorch compiling details: PyTorch built with:TorchVision: 0.16.1 OpenCV: 4.9.0 MMEngine: 0.10.3 MMDetection: 3.3.0+cfd5d3a
Error traceback If applicable, paste the error trackback here.
After 1 step of epoch bbox_mAP is 0 in validation.
2024/10/28 13:04:28 - mmengine - INFO - Epoch(val) [1][6000/6000] coco/bbox_mAP: 0.0000 coco/bbox_mAP_50: 0.0000 coco/bbox_mAP_75: 0.0000 coco/bbox_mAP_s: 0.0000 coco/bbox_mAP_m: 0.0010 coco/bbox_mAP_l: 0.0000 data_time: 0.0008 time: 0.0354