QwenLM / Qwen2-VL

Qwen2-VL is the multimodal large language model series developed by Qwen team, Alibaba Cloud.
Apache License 2.0
2.67k stars 153 forks source link

微调训练集的图片数量有限制吗 #120

Open BrenchCC opened 1 month ago

BrenchCC commented 1 month ago
[rank0]:   File "/home/vayu/.local/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get
[rank0]:     raise self._value
[rank0]: ValueError: `len(images)` is less than the number of <image> tokens.

但是我检查过我的文件,token和images的数量是相同的,是有限制吗,我有超过20张图片的数据

for item in merged_data:
    # images 列表的长度
    image_count = len(item['images'])
    for conversation in item['conversation']:
         if conversation['role'] == 'user':
           # 查找所有 <image> 标签
            image_tags = re.findall(r'<image>', conversation['content'])
            tag_count = len(image_tags)
            if tag_count != image_count:
                print(item['id'])

上述的检查代码没有抛出异常,merged_data是我数据制作时的总列表

BrenchCC commented 1 month ago

类似于这种:

{
        "id": "MIMICIT-VST_INS_33728",
        "images": [
            "visual_story_telling/VST_IMG_5532932164.png",
            "visual_story_telling/VST_IMG_5532321141.png",
            "visual_story_telling/VST_IMG_5532925352.png",
            "visual_story_telling/VST_IMG_5532909082.png",
            "visual_story_telling/VST_IMG_5532371867.png",
            "visual_story_telling/VST_IMG_5532963768.png",
            "visual_story_telling/VST_IMG_5532361349.png",
            "visual_story_telling/VST_IMG_5532970202.png",
            "visual_story_telling/VST_IMG_5532897848.png",
            "visual_story_telling/VST_IMG_5532384487.png",
            "visual_story_telling/VST_IMG_5532946646.png",
            "visual_story_telling/VST_IMG_5532395753.png",
            "visual_story_telling/VST_IMG_5532971954.png",
            "visual_story_telling/VST_IMG_5532951158.png",
            "visual_story_telling/VST_IMG_5532336893.png",
            "visual_story_telling/VST_IMG_5532367161.png",
            "visual_story_telling/VST_IMG_5532974810.png",
            "visual_story_telling/VST_IMG_5532378277.png",
            "visual_story_telling/VST_IMG_5532914026.png",
            "visual_story_telling/VST_IMG_5532375177.png",
            "visual_story_telling/VST_IMG_5532356075.png"
        ],
        "conversation": [
            {
                "role": "user",
                "content": "What was the atmosphere like during Adnin and Adila's wedding ceremony? <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image>"
            },
            {
                "role": "assistant",
                "content": "Unfortunately, there isn't much information about the wedding ceremony itself. However, based on the available annotations, we can assume that there was a sense of excitement and anticipation leading up to the ceremony. Adila was described as being \"all done\" and waiting for her groom, while Adnin was running a little behind getting ready and starting to get nervous. We can also infer that the couple took some pictures together before the ceremony, and they looked great and happy together."
            },
            {
                "role": "user",
                "content": "What did Adila plan for her wedding day? <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image>"
            },
            {
                "role": "assistant",
                "content": "The annotations suggest that Adila had made a plan for her wedding day, but the details are not clear. It's possible that she had a specific vision or theme in mind for the event, or that she had carefully planned out the logistics and details to ensure a smooth and enjoyable day."
            },
            {
                "role": "user",
                "content": "What was the significance of Adnin and Adila renewing their vows? <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image>"
            },
            {
                "role": "assistant",
                "content": "There isn't much information about why Adnin and Adila chose to renew their vows, but it's possible that they wanted to reaffirm their commitment to each other and celebrate their love in a meaningful way. Renewing vows can be a way for couples to mark a special occasion or milestone in their relationship, or to create a new beginning after a difficult time. Whatever their reasons, it was clearly a special and joyful day for them."
            },
            {
                "role": "user",
                "content": "Who was worried that Adila would never marry? <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image>"
            },
            {
                "role": "assistant",
                "content": "According to one of the annotations, Adila's grandmother was worried that her \"beautiful granddaughter\" would never marry. This suggests that there may have been some cultural or family pressure on Adila to find a partner and start a family, and that her grandmother may have been particularly invested in her love life and future."
            },
            {
                "role": "user",
                "content": "How did Adnin and Adila look in their wedding photos? <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image> <image>"
            },
            {
                "role": "assistant",
                "content": "Based on the available annotations, Adnin and Adila looked great and happy together in their wedding photos. They were described as \"the beautiful couple\" and \"the king and queen,\" suggesting that they were the center of attention and admired by those around them. The annotations also suggest that Adila took great care in preparing for the big day, getting her makeup done and adding some last-minute touches before the ceremony."
            }
        ],
hiyouga commented 1 month ago

Solved in https://github.com/hiyouga/LLaMA-Factory/issues/5375#issuecomment-2335533588