ogkalu2 / Merge-Stable-Diffusion-models-without-distortion

Adaptation of the merging method described in the paper - Git Re-Basin: Merging Models modulo Permutation Symmetries (https://arxiv.org/abs/2209.04836) for Stable Diffusion
MIT License
139 stars 21 forks source link

KeyError: 'log_one_minus_alphas_cumprod' #6

Open 7Tenku opened 1 year ago

7Tenku commented 1 year ago

I have been getting this error since the beginning and still get the same error after the updates. Maybe I have a wrong version of jax or flax installed? Beneath is the error I get when I am almost done merging. 1/P_bg251: 0.0 1/P_bg275: 0.0 1/P_bg227: 0.0 1/P_bg92: 0.0 1/P_model.diffusion_model.input_blocks.5.0_inner3: 0.0 1/P_bg133: 0.0 Traceback (most recent call last): File "C:\Users\x\Desktop\Merge-Stable-Diffusion-models-without-distortion-main\Merge-Stable-Diffusion-models-without-distortion-main\SD_rebasin_merge.py", line 27, in for axis, p in enumerate(permutation_spec.axes_to_perm[a]): KeyError: 'log_one_minus_alphas_cumprod'

ogkalu2 commented 1 year ago

What models are you trying to merge ?

Anyway to fix it, go to the weight matching file then sdunet permutation spec add **skip("log_one_minus_alphas_cumprod", None, None ) to the skipped layers

7Tenku commented 1 year ago

I am merging 2 already merged models. One is a NAI merge because normal NAI doesn't seem to work. I am now getting KeyError: 'model_ema.decay' Should I skip this layer too?

ogkalu2 commented 1 year ago

Yes skip every layer like this

vaguenebula commented 1 year ago

Also had this issue. was trying to merge a dreambooth model and trinart characters.

vaguenebula commented 1 year ago

btw, i was able to merge models finally by using gpu to do the matrix multiplication. ill make a pull request soon