running SD on AMD GPU, AttributeError: 'LMSDiscreteScheduler' object has no attribute 'set_format error

#160
by mokou123 - opened

I have the newest version of transformers and diffusers but the issue persists. Not sure what to do.

Same here, also the newest datasets.

Tried, pip install transformers==4.17.0

error gone, but new one

ImportError: cannot import name 'ModelOutput' from 'transformers.utils' (C:\Program Files\Python310\lib\site-packages\transformers\utils_init_.py)

same here.

Same. Don't know what to do now. Tried upgrading diffusers, transformers, etc. Same results.

guess were all stuck here?

same here

yup, been following this thread and so far we are stuck i think

also having this issue, any updates?

Hey,

Sorry to answer so late here! Could you please not call set_format(...) anymore at all? We removed this operation as it didn't do anything. Where did you see it? Could you post a code example here?

I got this when trying to use https://github.com/gammagec/stable-diffusion-gui to init Stable Diffusion:

Here's the log:

Initializing...
Fetching 16 files: 0%| | 0/16 [00:00<?, ?it/s]
Fetching 16 files: 100%|##############################################################| 16/16 [00:00<00:00, 512.02it/s]
Exception in thread Thread-1 (worker_init):
Traceback (most recent call last):
File "C:\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Python310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\stable_diffusion_amd\diffusers-dml\examples\inference\stbl_gui.py", line 59, in worker_init
self.pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", scheduler=self.lms, use_auth_token=True)
File "C:\stable_diffusion_amd\diffusers-dml\amd_venv\lib\site-packages\diffusers\pipeline_utils.py", line 730, in from_pretrained
model = pipeline_class(**init_kwargs)
File "C:\stable_diffusion_amd\diffusers-dml\examples\inference\dml_onnx.py", line 29, in init
scheduler = scheduler.set_format(format)
AttributeError: 'LMSDiscreteScheduler' object has no attribute 'set_format'

But I tried to launch it without this GUI and the result was pretty much the same:

(amd_venv) C:\stable_diffusion_amd\diffusers-dml\examples\inference.bak>python dml_onnx.py
Fetching 16 files: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 16/16 [00:00<00:00, 1024.17it/s]
Traceback (most recent call last):
File "C:\stable_diffusion_amd\diffusers-dml\examples\inference.bak\dml_onnx.py", line 206, in
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", scheduler=lms, use_auth_token=True)
File "C:\stable_diffusion_amd\diffusers-dml\amd_venv\lib\site-packages\diffusers\pipeline_utils.py", line 730, in from_pretrained
model = pipeline_class(**init_kwargs)
File "C:\stable_diffusion_amd\diffusers-dml\examples\inference.bak\dml_onnx.py", line 28, in init
scheduler = scheduler.set_format(format)
AttributeError: 'LMSDiscreteScheduler' object has no attribute 'set_format'

(amd_venv) C:\stable_diffusion_amd\diffusers-dml\examples\inference.bak>

To get everything set up I followed this guide:
https://pythoninoffice.com/run-stable-diffusion-amd-gpu-on-windows/

Appreciate your help!

Update 1/11/2023 3:46AM: I had the same issue, and after a couple hours I gave up and began to follow a new guide.

My recommendation to anyone struggling with these error strings, start over with a more recent setup guide. Brute forcing this one is problematic.

The set_format error in my case was resolved by using the version of 'transformers' intended (in my case 4.23.1) vs the latest 4.25.1,

pip install transformers==4.23.1

YMMV, a newer guide indeed is likely the best course but just in case you want to press on. :)

Update 1/11/2023 3:46AM: I had the same issue, and after a couple hours I gave up and began to follow a new guide.

My recommendation to anyone struggling with these error strings, start over with a more recent setup guide. Brute forcing this one is problematic.

Got a recommendation?

Sign up or log in to comment