Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the prompt exceeds the length #61

Closed
jsk1107 opened this issue Nov 21, 2022 · 6 comments
Closed

When the prompt exceeds the length #61

jsk1107 opened this issue Nov 21, 2022 · 6 comments

Comments

@jsk1107
Copy link

jsk1107 commented Nov 21, 2022

hello.

Q1.
The total number of classes in the custom data set I have is about 300. So it throws an error. I think this error occurs because the dimension of the logit is [:, :, 256] but the value index of my positive map is greater than 256. Am i right?

Q2.
In #37 "If the prompt exceeds the length, you can take a look at the inference codes about how we deal with the LVIS dataset (~1200 classes)" said.
Can converting coco annotations to LVIS annotations solve the error in Q1? If so, Is there an API that provides conversion between annotations?

@Haotian-Zhang
Copy link
Collaborator

@jsk1107 Thank you for the questions! Yes, the error is due to the maximum length of the text encoder input, which is 256. You can convert your label directly to LVIS format. There shall be no such big differences between the COCO and LVIS label files. The only thing you may do is modify the datasets section in the config file to make sure the model knows what kind of data you are specifying.

@jsk1107
Copy link
Author

jsk1107 commented Nov 22, 2022

@Haotian-Zhang Problem solved. thank you

I have one more question. How should spaces be handled when entering prompts?

ex) aerosolcan / aerosol can / aerosol_can
ex) airconditioner / air conditioner / air_conditioner

WordNet seems to provide underscores, not spaces. It is also underscore in LVIS annotation. Is it a good practice to use underscores for correct prompting?

@Haotian-Zhang
Copy link
Collaborator

Hi @jsk1107, I don't think underscore make senses in our case. Since we are using BERT as our text encoder, and it was pre-trained on the natural sentences styles. Besides, our detection prompt is also using spaces in between the class categories. Please let us know if you have further concerns.

@jsk1107
Copy link
Author

jsk1107 commented Nov 25, 2022

@Haotian-Zhang Thanks! I'll close this issue.

@jsk1107 jsk1107 closed this as completed Nov 25, 2022
@nanfei666
Copy link

nanfei666 commented Jun 8, 2023

@jsk1107 Thank you for the questions! Yes, the error is due to the maximum length of the text encoder input, which is 256. You can convert your label directly to LVIS format. There shall be no such big differences between the COCO and LVIS label files. The only thing you may do is modify the datasets section in the config file to make sure the model knows what kind of data you are specifying.

@Haotian-Zhang Hi, i am not sure which part should be modified in the config file if i have a coco formate annotation file while have much more class, could you point it out for me . thank you

@vishalvijay99
Copy link

@jsk1107 what changes did you make? Can you please elaborate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants