i got error '' cannot import name 'CLIPVisionModelWithProjection' from 'transformers '' #57

by lirly - opened

i tried to construct it in my drive and it occured. pls teach me how to solve it...

ImportError Traceback (most recent call last)
in
2 import torch
3 from torch import autocast
----> 4 from diffusers import StableDiffusionPipeline
5
6 model_id = "hakurei/waifu-diffusion"

3 frames
/usr/local/lib/python3.7/dist-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py in
20 import PIL
21 from diffusers.utils import is_accelerate_available
---> 22 from transformers import CLIPFeatureExtractor, CLIPVisionModelWithProjection
23
24 from ...models import AutoencoderKL, UNet2DConditionModel

ImportError: cannot import name 'CLIPVisionModelWithProjection' from 'transformers' (/usr/local/lib/python3.7/dist-packages/transformers/init.py)

error full text

I had the same error. Installing the latest version of transformers from source resolved the issue:

pip install git+https://github.com/huggingface/transformers