Skip to content

module transformers has no attribute CLIPFeatureExtractor #12492

@jiqing-feng

Description

@jiqing-feng

System Info

latest main

Who can help?

@SunMarc

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

from diffusers import AnimateDiffPipeline

pipe = AnimateDiffPipeline.from_pretrained("emilianJR/epiCRealism")

error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/jiqing/diffusers/src/diffusers/pipelines/pipeline_utils.py", line 1024, in from_pretrained
    loaded_sub_model = load_sub_model(
                       ^^^^^^^^^^^^^^^
  File "/home/jiqing/diffusers/src/diffusers/pipelines/pipeline_loading_utils.py", line 752, in load_sub_model
    class_obj, class_candidates = get_class_obj_and_candidates(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jiqing/diffusers/src/diffusers/pipelines/pipeline_loading_utils.py", line 419, in get_class_obj_and_candidates
    class_obj = getattr(library, class_name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jiqing/transformers/src/transformers/utils/import_utils.py", line 1920, in __getattr__
    raise AttributeError(f"module {self.__name__} has no attribute {name}")
AttributeError: module transformers has no attribute CLIPFeatureExtractor

Expected behavior

As transformers deprecated FeatureExtractor classes in favor of ImageProcessor classes for image preprocessing. How to handle models that already set FeatureExtractor in model hub like emilianJR/epiCRealism?

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions