Skip to content

Commit

Permalink
Fix Grounding DINO nan when class tokens exceeds 256 (#11066)
Browse files Browse the repository at this point in the history
  • Loading branch information
Divadi authored Oct 20, 2023
1 parent 1fb2ac3 commit 88dfe48
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 88dfe48

Please sign in to comment.