Closed vjsrinivas closed 1 year ago
Hi @vjsrinivas, thanks for reporting!
I've opened #25497 which should resolve this issue
@amyeroberts thanks for the quick reply! Do we pip install from the github project for these kinds of hotfixes?
@vjsrinivas Yes, once the PR is merged in, you'll need to install from source to have the current changes in main. They will be included in the next version release.
System Info
transformers
version: 4.31.0Who can help?
@amyeroberts I was trying to finetune Mask2Former with my own custom dataset, but I ran into an error when calling the
Mask2FormerImageProcessor.post_process_instance_segmentation
. I'm getting the following error when I setreturn_coco_annotation=True
and a relatively low confidence threshold:Could the issue be that the
convert_segmentation_to_rle
is called within the query loop rather than outside: https://github.com/huggingface/transformers/blob/0ebe7ae16076f727ac40c47f8f9167013c4596d8/src/transformers/models/mask2former/image_processing_mask2former.py#L1031 The segmentation tensor turns into aList[List]
, which might be causing the TypeError.Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
It's not practical to give you the custom training loop I have, but I recreated the situation with the ADE20K example for MaskFormer. Note that I stop this model's training within the first iteration and set the confidence threshold to 0.001 (error also occurs at 0.01, 0.1, etc). The error still occurs when I do a full epoch on my custom dataset.
Expected behavior
Mask2FormerImageProcessor.post_process_instance_segmentation
not erroring out regardless of model segmentation output.