AILab-CVC / YOLO-World

[CVPR 2024] Real-Time Open-Vocabulary Object Detection
https://www.yoloworld.cc
GNU General Public License v3.0
4.39k stars 427 forks source link

I can run with the detector, but segmentation has an issue. The test dataset is COCO and LVIS. #84

Open POVTUASTHOV opened 6 months ago

POVTUASTHOV commented 6 months ago

Here is the error: File "/home/server/Python_Project/django/yolo/YOLO-World/yolo_world/datasets/utils.py", line 28, in yolow_collate masks = datasamples.gt_instances.masks.to_tensor( AttributeError: 'Tensor' object has no attribute 'to_tensor'

ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 637801) of binary: /home/server/miniconda3/envs/TUA/bin/python ERROR:torch.distributed.elastic.agent.server.local_elastic_agent:[default] Worker group failed

wondervictor commented 6 months ago

Hi @POVTUASTHOV, you can try to modify yolo_world/datasets/utils.py:L28 as:

if 'masks' in datasamples.gt_instances:
    masks = datasamples.gt_instances.masks.to(
        dtype=torch.bool, device=gt_bboxes.device)
    batch_masks.append(masks)
POVTUASTHOV commented 6 months ago

Thanks to @wondervictor help, I have successfully fixed the previous error, but a new error has arisen.

File "/home/server/Python_Project/django/yolo/YOLO-World/yolo_world/models/dense_heads/yolo_world_seg_head.py", line 440, in loss_by_feat
    assigned_gt_idxs = assigned_result['assigned_gt_idxs']
KeyError: 'assigned_gt_idxs'
    assigned_gt_idxs = assigned_result['assigned_gt_idxs']
KeyError: 'assigned_gt_idxs'
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 9507) of binary: /home/server/miniconda3/envs/TUA/bin/python
ERROR:torch.distributed.elastic.agent.server.local_elastic_agent:[default] Worker group failed
I
wondervictor commented 6 months ago

Hi, you might need to modify the file in mmyolo, specifically mmyolo/models/task_modules/batch_task_aligned_assigner.py, insert the below line

assigned_result['assigned_gt_idxs'] = assigned_gt_idxs

in Line 142.

We will fix it soon.

wondervictor commented 6 months ago

Hi @POVTUASTHOV, this error has been fixed! Now the training & evaluation are both supported!