Yuliang-Liu / Monkey

【CVPR 2024 Highlight】Monkey (LMM): Image Resolution and Text Label Are Important Things for Large Multi-modal Models
MIT License
1.78k stars 123 forks source link

TypeError: list indices must be integers or slices, not str #144

Open Nice-Zhang66 opened 4 hours ago

Nice-Zhang66 commented 4 hours ago

Hello author, I encountered an error while reproducing the code, I just used the link to download the json file in your readme to train and pointed to train_monkey.json with --data_path, but the error is reported as follows: "TypeError: list indices must be integers or slices, not str." 20240925121643

echo840 commented 4 hours ago

Hello, you need to replace with the folder where you place the images.

image

Nice-Zhang66 commented 3 hours ago

20240925133902 You can see the path in this image, I followed the format of train_monkey.json and wrote the json file with my own image and the corresponding comments, but I still get the above error when reading into the code.

Nice-Zhang66 commented 2 hours ago

很感谢您的回复,我在尝试用我自己的图片集和对应的注释对Monkey进行微调,但是按照您的train_monkey.json的格式编写了我自己的json文件,但是进行训练还是会报错

Wenbo Zhang

@. | ---- Replied Message ---- | From | @.> | | Date | 9/25/2024 12:52 | | To | @.> | | Cc | @.>, @.***> | | Subject | Re: [Yuliang-Liu/Monkey] TypeError: list indices must be integers or slices, not str (Issue #144) |

Hello, you need to replace with the folder where you place the images.

image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

echo840 commented 40 minutes ago

Can you use the following code to read train_monkey.json and output the value? Will using the provided train_monkey.json cause this error?

import json

path = "train_monkey.json"
with open(path,"r") as f:
    data = json.load(f)
print(data[0]['conversations'][1]['value'])