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

[Question] image_features not matched to input text #11

Open
sibosutd opened this issue Apr 8, 2024 · 0 comments
Open

[Question] image_features not matched to input text #11

sibosutd opened this issue Apr 8, 2024 · 0 comments

Comments

@sibosutd
Copy link

sibosutd commented Apr 8, 2024

if i < num_images:
for j in range(5):
cur_image_features = image_features[cur_image_idx+j*16]
cur_new_input_embeds.append(cur_image_features)
cur_new_labels.append(torch.full((cur_image_features.shape[0],), IGNORE_INDEX, device=cur_labels.device, dtype=cur_labels.dtype))

  1. In the code snippet above, I notice that the value of cur_image_idx doesn't change within a single batch. This implies that cur_image_features remain identical for images within the same batch, which seems unusual. Could you confirm if this is the intended behavior?

  2. Another point of confusion I have pertains to the line for j in range(5): and the expression j*16. Based on the settings used in the Resampler, I would expect the image_features to have dimensions [batch_size*8, 64, 5120]. Can you clarify why the image features are selected using for j in range(5): and j*16?

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

1 participant