ROOT icon indicating copy to clipboard operation
ROOT copied to clipboard

Issue with Qwen2-VL-7B-FULL-full

Open liurunzhou1111 opened this issue 9 months ago • 2 comments

When I try to load the processor of this model by running the line self.processor = AutoProcessor.from_pretrained(checkpoint) in the file qwen2vl_sft.py, an error message occurs like below:

ValueError: size must contain 'shortest_edge' and 'longest_edge' keys.

The message mentions that there should be shortest_edge and longest_edge keys inside the config file, and I couldn't find these keys. How should I solve this issue? Thanks!

liurunzhou1111 avatar Mar 29 '25 02:03 liurunzhou1111

The full error message looks like below:

Traceback (most recent call last): File "/cpfs01/shared/XNLP_H800/liurunzhou/ROOT/main.py", line 45, in my_vlm.initialize_llm(checkpoint=config.qwen_checkpoint) File "/cpfs01/shared/XNLP_H800/liurunzhou/ROOT/api/qwen2vl_sft.py", line 22, in initialize_llm self.processor = AutoProcessor.from_pretrained(checkpoint) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/auto/processing_auto.py", line 345, in from_pretrained return processor_class.from_pretrained( File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/processing_utils.py", line 1070, in from_pretrained args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/processing_utils.py", line 1134, in _get_arguments_from_pretrained args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs)) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/auto/image_processing_auto.py", line 557, in from_pretrained return image_processor_class.from_dict(config_dict, **kwargs) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/image_processing_base.py", line 423, in from_dict image_processor = cls(**image_processor_dict) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/qwen2_vl/image_processing_qwen2_vl.py", line 144, in init raise ValueError("size must contain 'shortest_edge' and 'longest_edge' keys.") ValueError: size must contain 'shortest_edge' and 'longest_edge' keys.

liurunzhou1111 avatar Mar 29 '25 02:03 liurunzhou1111

The full error message looks like below:

Traceback (most recent call last): File "/cpfs01/shared/XNLP_H800/liurunzhou/ROOT/main.py", line 45, in my_vlm.initialize_llm(checkpoint=config.qwen_checkpoint) File "/cpfs01/shared/XNLP_H800/liurunzhou/ROOT/api/qwen2vl_sft.py", line 22, in initialize_llm self.processor = AutoProcessor.from_pretrained(checkpoint) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/auto/processing_auto.py", line 345, in from_pretrained return processor_class.from_pretrained( File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/processing_utils.py", line 1070, in from_pretrained args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/processing_utils.py", line 1134, in _get_arguments_from_pretrained args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs)) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/auto/image_processing_auto.py", line 557, in from_pretrained return image_processor_class.from_dict(config_dict, **kwargs) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/image_processing_base.py", line 423, in from_dict image_processor = cls(**image_processor_dict) File "/cpfs01/shared/XNLP_H800/liurunzhou/conda-envs/ROOT/lib/python3.10/site-packages/transformers/models/qwen2_vl/image_processing_qwen2_vl.py", line 144, in init raise ValueError("size must contain 'shortest_edge' and 'longest_edge' keys.") ValueError: size must contain 'shortest_edge' and 'longest_edge' keys.

I guess it might be an issue with the transformer version. Can you try upgrading the version?

harrytea avatar Mar 29 '25 13:03 harrytea