Question about NaN in DPMSolverMultistepInverseScheduler #10720
Unanswered
DekuLiuTesla
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, everyone, I'm new to diffusers. I'm trying to use DPMSolverMultistepInverseScheduler for DDIM inversion. The applied config is:
And the DDIM inversion is realized through:
But NaN occurs in the first scheduler step. I dug into it and found it happens in
dpm_solver_first_order_update
:diffusers/src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py
Lines 627 to 633 in 560fb5f
The self.sigmas is
tensor([ 0.0292, 0.0462, 0.0710, 0.1065, 0.1563, 0.2249, 0.3178, 0.4417, 0.6050, 0.8176, 1.0911, 1.4396, 1.8795, 2.4300, 3.1132, 3.9548, 4.9844, 6.2356, 7.7471, 9.5622, 11.7303, 14.3068, 17.3539, 20.9411, 25.1461, 25.1461])
. Its increasing order leadslambda_t
to be smaller thanlambda_s
and therefore a negativeh
.As a result, in
diffusers/src/diffusers/schedulers/scheduling_dpmsolver_multistep_inverse.py
Lines 638 to 644 in 560fb5f
torch.sqrt(1.0 - torch.exp(-2 * h))
becomes NaN. But I noticed that inDPMSolverMultistepScheduler
, the problem is avoided by applying flip:diffusers/src/diffusers/schedulers/scheduling_dpmsolver_multistep.py
Lines 395 to 396 in 560fb5f
I've searched for many usage examples, but I still can't figure out the stem of the problem. Is there anybody that can give a help?🙏
Beta Was this translation helpful? Give feedback.
All reactions