Closed ferjorosa closed 9 months ago
Hey! Thanks for reporting 🤗 would you like to open a PR for a fix?
Hi, yes. I have created a PR. Could you take a look into it?
Thanks
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
System Info
transformers==4.35.2
Who can help?
@ArthurZucker @younesbelkada @amyeroberts
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Error is thrown when doing pretraining with an
itm_labels
tensor that contains both 0s and 1s. Just as a reminder, to execute the ITM task successfully, pairs of image descriptions that do not match are required. The unmatched pairs are identified with a1
in the itm_labels` list.Error:
In order to properly reproduce this error, I have also prepared a Google colab notebook, which can be found here
As a side note, this error may go unnoticed if all items in
itm_labels
are 0s, indicating that they all match, or if they are all 1s, signifying that none of them match. However, it's important to comment that in the code, whenitm_labels
contains all 1s, it is automatically translated into all 0s. This automatic "translation" may result in unexpected behaviours for the user.Expected behavior
The error occurs because inside Flava's code the
pos_mask
is applied multiple times. It is first applied on line 1953 and then on lines 1968 (MMM-image) and 1991 (MMM-text) of modeling_flava.py. I think it would be fixed by just removing the second and third application of the mask.