google / prompt-to-prompt

Apache License 2.0
2.98k stars 279 forks source link

a question about running code #56

Open universezhao opened 1 year ago

universezhao commented 1 year ago

error: text_config_dict is provided which will be used to initialize CLIPTextConfig. The value text_config["id2label"] will be overriden.

TypeError Traceback (most recent call last) Input In [17], in <cell line: 7>() 5 MAX_NUM_WORDS = 77 6 device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') ----> 7 ldm_stable = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=MY_TOKEN).to(device) 8 tokenizer = ldm_stable.tokenizer

File ~/miniconda3/lib/python3.8/site-packages/diffusers/pipeline_utils.py:373, in DiffusionPipeline.from_pretrained(cls, pretrained_model_name_or_path, **kwargs) 370 if issubclass(class_obj, class_candidate): 371 load_method_name = importable_classes[class_name][1] --> 373 load_method = getattr(class_obj, load_method_name) 375 loading_kwargs = {} 376 if issubclass(class_obj, torch.nn.Module):

TypeError: getattr(): attribute name must be string

SleeplessBegonia commented 1 year ago

me too!how did u solve it?

failbetter77 commented 1 year ago

maybe 1) use diffusers==0.14.0 2) change forward function, in ptp_utils.py https://github.com/google/prompt-to-prompt/issues/44#issuecomment-1598814709