Open lmydian1014 opened 4 weeks ago
Hi, @lmydian1014 this error is similar with https://github.com/X-PLUG/mPLUG-DocOwl/issues/65. This may be because the number of image placeholders in the text input is not equal to the number of image features. There may be multiple input images and only 1 <|image|> in your query.
Thanks! Just to double check, if I have 5 images and each image has 3 corresponding questions. Previously the ./images folder contains 5 images and I prepared the .json file as follows
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_content of this product?"}, {"role": "assistant", "content": "9g"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_daily_value this product?"}, {"role": "assistant", "content": "18%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_content of this product?"}, {"role": "assistant", "content": "17mg"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_daily_value this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_content of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the carbohydrate_content of this product?"}, {"role": "assistant", "content": "17g"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the carbohydrate_daily_value of this product?"}, {"role": "assistant", "content": "6%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_C_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_Content of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_C_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_Content of this product?"}, {"role": "assistant", "content": "0mcg"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
What you mean is that I need to have 15 images in ./images folder and also need to change image name in ./images folder and in .json file as "81ouNxgyqBL_1.jpg", ''81ouNxgyqBL_2.jpg'', ''81ouNxgyqBL_3.jpg''?
Thanks! Just to double check, if I have 5 images and each image has 3 corresponding questions. Previously the ./images folder contains 5 images and I prepared the .json file as follows
{"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_content of this product?"}, {"role": "assistant", "content": "9g"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_daily_value this product?"}, {"role": "assistant", "content": "18%"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81ouNxgyqBL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_content of this product?"}, {"role": "assistant", "content": "17mg"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the added_sugar_daily_value this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_content of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51wyfiAQhvL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the calcium_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the carbohydrate_content of this product?"}, {"role": "assistant", "content": "17g"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/71NXqwfW9cL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the carbohydrate_daily_value of this product?"}, {"role": "assistant", "content": "6%"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_C_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_Content of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/81TZLOCqbjL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_C_daily_value of this product?"}, {"role": "assistant", "content": "nan"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_Content of this product?"}, {"role": "assistant", "content": "0mcg"}], "task_name": "qa_sft", "dataset_name": "nutrition"} {"image": ["/home/ubuntu/moyanli/mPLUG-DocOwl/DocOwl1.5/image/51J22uvz4jL.jpg"], "messages": [{"role": "user", "content": "<|image|>What is the vitamin_D_daily_value of this product?"}, {"role": "assistant", "content": "0%"}], "task_name": "qa_sft", "dataset_name": "nutrition"}
What you mean is that I need to have 15 images in ./images folder and also need to change image name in ./images folder and in .json file as "81ouNxgyqBL_1.jpg", ''81ouNxgyqBL_2.jpg'', ''81ouNxgyqBL_3.jpg''?
Hi, @lmydian1014 , this JSON file is ok. Please check whether all samples in your JSON file raise the IndexError or just partial samples. If only partial samples, could you provide some examples? (ps: the bath_idx=0 is because the per_device_train_batch_size=1 )
I have the following error when finetune the DocOwl1.5-Omni. It always raises error when index is 10. Please help!!!
Below is my script.
I have tried to print the batch idx, it's weird that it always equal to 0. screenshot is provided below![image_123650291](https://github.com/X-PLUG/mPLUG-DocOwl/assets/54998807/6cd9491c-bba8-4254-9013-8ece2bb07441)