Skip to content

Commit

Permalink
Fix Grounding DINO nan when class tokens exceeds 256 (open-mmlab#11066)
Browse files Browse the repository at this point in the history
  • Loading branch information
Divadi authored and yumion committed Jan 31, 2024
1 parent 247b468 commit 2b26726
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mmdet/models/detectors/grounding_dino.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def get_tokens_and_prompts(
return tokenized, caption_string, tokens_positive, entities

def get_positive_map(self, tokenized, tokens_positive):
positive_map = create_positive_map(tokenized, tokens_positive)
positive_map = create_positive_map(
tokenized,
tokens_positive,
max_num_entities=self.bbox_head.cls_branches[
self.decoder.num_layers].max_text_len)
positive_map_label_to_token = create_positive_map_label_to_token(
positive_map, plus=1)
return positive_map_label_to_token, positive_map
Expand Down

0 comments on commit 2b26726

Please sign in to comment.