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

VILA models crashing when bounding boxes are not int #76

Closed
wants to merge 2 commits into from

Conversation

soldni
Copy link
Member

@soldni soldni commented Apr 22, 2022

VILA models crashing when bounding boxes are not int

Because of changes in #69 , bounding boxes are now float instead of int, which VILA does not like:

  File "/Users/lucas/miniforge3/envs/pdod/lib/python3.10/site-packages/mmda/predictors/hf_predictors/vila_predictor.py", line 161, in predict
    model_outputs = self.model(**self.model_input_collator(model_inputs))
  File "/Users/lucas/miniforge3/envs/pdod/lib/python3.10/site-packages/mmda/predictors/hf_predictors/vila_predictor.py", line 178, in model_input_collator
    return {
  File "/Users/lucas/miniforge3/envs/pdod/lib/python3.10/site-packages/mmda/predictors/hf_predictors/vila_predictor.py", line 179, in <dictcomp>
    key: torch.tensor(val, dtype=torch.int64, device=self.device)
TypeError: 'float' object cannot be interpreted as an integer

This PR adds an explicit cast operation to get around this issue during pre-processing.

@lolipopshock
Copy link
Collaborator

Thanks @soldni ! This issue is also fixed in vila allenai/vila@0a77203 and I'll migrate the changes to mmda very soon!

@lolipopshock
Copy link
Collaborator

fixed in #89 as latest vila lib fixes this issue

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

Successfully merging this pull request may close these issues.

None yet

2 participants