huggingface / optimum-habana

Easy and lightning fast training of 🤗 Transformers on Habana Gaudi processor (HPU)
Apache License 2.0
152 stars 198 forks source link

AttributeError: 'GaudiStableDiffusionPipeline' object has no attribute '_internal_dict' #199

Closed JunxiChhen closed 1 year ago

JunxiChhen commented 1 year ago

System Info

Optimum habana version: 1.5.0.dev
Docker image: vault.habana.ai/gaudi-docker/1.8.0/ubuntu20.04/habanalabs/pytorch-installer-1.13.1

Information

Tasks

Reproduction

  1. Goes into examples/stable-diffusionFor.
  2. Ran "python text_to_image_generation.py --model_name_or_path stabilityai/stable-diffusion-2-base --prompts "a photo of an astronaut riding a horse on mars" --num_images_per_prompt 1 --batch_size 1 --image_save_dir /tmp/stable_diffusion_images --use_habana --use_hpu_graph --gaudi_config Habana/stable-diffusion".
  3. Got error: AttributeError: 'GaudiStableDiffusionPipeline' object has no attribute '_internal_dict'

Expected behavior

Is there any method can fix this issue?

regisss commented 1 year ago

Hi @JunxiChhen! I'm currently working on a fix that should be merged soon. This bug appeared with the recent release of Diffusers 0.15 so in the meantime I recommend that you use Diffusers 0.14:

pip uninstall diffusers
pip install diffusers==0.14
JunxiChhen commented 1 year ago

Hi @JunxiChhen! I'm currently working on a fix that should be merged soon. This bug appeared with the recent release of Diffusers 0.15 so in the meantime I recommend that you use Diffusers 0.14:

pip uninstall diffusers
pip install diffusers==0.14

Thanks for your quick response. It works now.

regisss commented 1 year ago

@JunxiChhen #201 just got merged to enable compatibility with Diffusers 0.15.0. You'll need an install from source to get this fix:

pip install git+https://github.com/huggingface/optimum-habana.git

Also, a new version of Optimum Habana containing this fix will be released soon.