Skip to content

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

Description

@YingYellow

Thank you for your wonderful work. When I run the code of Quick Start, I faced the issue: ValueError: size must contain 'shortest_edge' and 'longest_edge' keys. The version of transformers I used is 4.53.2.

Traceback (most recent call last):
File "/home/ying/Projects/GUI_zoo/ShowUI/quicke_start.py", line 39, in
processor = AutoProcessor.from_pretrained("showlab/ShowUI-2B", min_pixels=min_pixels, max_pixels=max_pixels)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/models/auto/processing_auto.py", line 379, in from_pretrained
return processor_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/processing_utils.py", line 1306, in from_pretrained
args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/processing_utils.py", line 1365, in _get_arguments_from_pretrained
args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/models/auto/image_processing_auto.py", line 580, in from_pretrained
return image_processor_class.from_dict(config_dict, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/image_processing_base.py", line 412, in from_dict
image_processor = cls(**image_processor_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/ying/Anaconda3/envs/showui/lib/python3.11/site-packages/transformers/models/qwen2_vl/image_processing_qwen2_vl.py", line 141, in init
raise ValueError("size must contain 'shortest_edge' and 'longest_edge' keys.")
ValueError: size must contain 'shortest_edge' and 'longest_edge' keys.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions