92 contains a similar error, but is now closed because apparently updating the conda env solved it for them. Good for them, but doing that didn't work for me. Of course this happened several days and commits ago so I doubt it is relevant now. Reading through the code, I found the definition of sample at line 470:
How is sampler unexpected? It is obviously defined. opt.sampler is also initialized to plms if you don't specify a sampler, so it can't be that either. What gives?
Here's my output, even though it is basically the same as in #92 , just formatted in a more readable way.
$ python optimizedSD/optimized_txt2img.py --prompt "[REDACTED]" --H 448 --W 512 --n_samples 3 --n_iter 3 --ddim_steps 50
Global seed set to 303241
Loading model from models/ldm/stable-diffusion-v1/model.ckpt
Global Step: 470000
UNet: Running in eps-prediction mode
CondStage: Running in eps-prediction mode
FirstStage: Running in eps-prediction mode
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Using prompt: [REDACTED]
data: 0%| | 0/1 [00:03<?, ?it/s]
Sampling: 0%| | 0/3 [00:03<?, ?it/s]
Traceback (most recent call last):
File "optimizedSD/optimized_txt2img.py", line 299, in <module>
samples_ddim = model.sample(
File "/home/jul/.conda/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
TypeError: sample() got an unexpected keyword argument 'sampler'
92 contains a similar error, but is now closed because apparently updating the conda env solved it for them. Good for them, but doing that didn't work for me. Of course this happened several days and commits ago so I doubt it is relevant now. Reading through the code, I found the definition of
sample
at line 470:If we compare this to when it is called in
optimized_txt2img.py
, this error seems impossible:How is
sampler
unexpected? It is obviously defined.opt.sampler
is also initialized to plms if you don't specify a sampler, so it can't be that either. What gives? Here's my output, even though it is basically the same as in #92 , just formatted in a more readable way.