Closed eBeyzaG closed 4 months ago
@eBeyzaG I guess you have to add your classes id2label and label2id to the model while instantiating
something like this... model = AutoModelForUniversalSegmentation.from_pretrained( model_ckpt, is_training=is_train, id2label=id2label, label2id=label2id, ignore_mismatched_sizes=True )
Thank you for answering. While trying your answer I realized the real problem, I didn't specify is_training=True while instantiating the model causing the text queries to not be calculated. The error was caused by this.
I am fine tuning OneFormer for semantic segmentation and I have 5 classes including background. While training, I am also calculating mIOU so I extract segmentation maps. But as the model config has 150 classes, it outputs class numbers that do not exist in my dataset. I also tried changing num_labels parameter as shown below
But model gives error
How can I change class count while fine tuning?