Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: string indices must be integers #44

Open
Qzy568 opened this issue Nov 19, 2024 · 1 comment
Open

TypeError: string indices must be integers #44

Qzy568 opened this issue Nov 19, 2024 · 1 comment

Comments

@Qzy568
Copy link

Qzy568 commented Nov 19, 2024

您好,我想运行的代码infer_gpt.py,输入python infer/infer_gpt.py gpt-4o cot vision
但是报如下错误,报错函数在vision_mmmu_doc_to_visual(doc)
Generating train split: 1730 examples [00:03, 455.85 examples/s]
Begin processing vision
Processing vision: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 225, in
main()
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 221, in main
run_and_save()
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 216, in run_and_save
temp_files.append(process_and_save_part(dataset, SETTING, model_components))
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 207, in process_and_save_part
result, data = future.result()
File "/root/miniconda3/envs/humanevalv/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/root/miniconda3/envs/humanevalv/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/root/miniconda3/envs/humanevalv/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 172, in process_prompt
images = vision_mmmu_doc_to_visual(data)
File "/workspace/mm_eval/qzy/code/MMMU/mmmu-pro/infer/infer_gpt.py", line 71, in vision_mmmu_doc_to_visual
return [doc['image']]
TypeError: string indices must be integers

@Zheng0428
Copy link
Contributor

看起来doc在你这里是一个字符串,但实际上他是一个字典。
可以检查一下load_dataset的dataset是否正确,我看你这里显示的是Generating train split,但脚本里面是split='test',可以check一下是否是这个原因导致。希望可以解决你的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants