Official repository of OFA (ICML 2022). Paper: OFA: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework
Apache License 2.0
2.39k
stars
248
forks
source link
max_tgt_length is not used in data/mm_data/vqa_gen_dataset.py #412
Hi!
Thank you for this great work!
I think there is a small bug in data/mm_data/vqa_gen_dataset.py. When getitem in the dataset, it looks like you forget to set the max_tgt_length.
When the answers are very long, CUDA error will raise. So I changed code in line163, ref_dict = {item.split('|!+')[1]: float(item.split('|!+')[0]) for item in ref.split('&&')} -> ref_dict = {item.split('|!+')[1][:self.max_tgt_length]: float(item.split('|!+')[0]) for item in ref.split('&&')}. And in my cases, it made sense.
Thank you for your precious time!
Hi! Thank you for this great work! I think there is a small bug in data/mm_data/vqa_gen_dataset.py. When getitem in the dataset, it looks like you forget to set the max_tgt_length. When the answers are very long, CUDA error will raise. So I changed code in line163, ref_dict = {item.split('|!+')[1]: float(item.split('|!+')[0]) for item in ref.split('&&')} -> ref_dict = {item.split('|!+')[1][:self.max_tgt_length]: float(item.split('|!+')[0]) for item in ref.split('&&')}. And in my cases, it made sense. Thank you for your precious time!