Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in Merge LyCORIS - No module named 'lycoris.kohya_model_utils' #1231

Closed
neoraoz opened this issue Jul 19, 2023 · 11 comments
Closed

Problem in Merge LyCORIS - No module named 'lycoris.kohya_model_utils' #1231

neoraoz opened this issue Jul 19, 2023 · 11 comments

Comments

@neoraoz
Copy link

neoraoz commented Jul 19, 2023

I got a problem in Merge LyCORIS.
It was working fine, as far as I remember, but all of sudden, it's not working like this.

Error message is:
File "C:\kohya_ss\tools\merge_lycoris.py", line 41, in
from lycoris.kohya_model_utils import (
ModuleNotFoundError: No module named 'lycoris.kohya_model_utils'

the portion of the merge_lycoris.py is:
from lycoris_utils import merge
from lycoris.kohya_model_utils import (
load_models_from_stable_diffusion_checkpoint,
save_stable_diffusion_checkpoint,
load_file

I've tried to sort this out by re-installing the KOHY_SS from the scratch, but it's not working with same error message, though.

Anyone who has same problem, or remedy, would you be so kind to let me know the way to solve this problem?
Many thanks in advance.

@bmaltais
Copy link
Owner

There is probably a solution by downgrading to a previous release of LyCORIS by editing the requirements.txt file... This would being back the release that had the file the utility is looking for

@neoraoz
Copy link
Author

neoraoz commented Jul 19, 2023

Thx for your comment.
I've downgraded lycoris_lora from 1.8.0.dev9 to 1.7.2, now I have different error message.
RuntimeError: Error(s) in loading state_dict for AutoencoderKL:
Missing key(s) in state_dict: "encoder.mid_block.attentions.0.to_q.weight", blah blah.
So, I tried 0.1.0 & 0.1.4 & 0.1.6 & 0.1.7, unfortunately nothing worked with similar error message as above.

Then, I tried 1.8.0.dev1 - 1.8.0.dev3, it was not woking. However I found that the error message of "No module named 'lycoris.kohya_model_utils'" strated to appear from 1.8.0.dev4

Any recommendation for the version of lycoris_lora which is working for this merging process?

@Boldor83
Copy link

downgrading the whole gui to 21.7.16 works so not sure why
lycoris_lora==0.1.6 doesn't . I haven't tried changing just that myself.

@neoraoz
Copy link
Author

neoraoz commented Jul 20, 2023

I've downloaded kohya_ss-21.7.16.zip and installed it. After installation procedure, the GUI could turned up, but all the command from action in GUI doesn't make any response, such as open file dialogue>
Please let me know how I can 'downgrading the whole gui to 21.7.16'

@bmaltais
Copy link
Owner

bmaltais commented Jul 20, 2023

I think browser updates are causing gradio to no longer work... You could try to update the gradio release in the requirements.txt file to match the current version... should bring the GUI back to life. The right solution would be for the LyCORIS author to update his python module... or update his utility to extreact lhe LoRA.

@neoraoz
Copy link
Author

neoraoz commented Jul 20, 2023

Many thx to your kindness.
With GUI version of 21.7.16 and recent gradio, everythig works fine.
Problem solved.

@nikolaiusa
Copy link

nikolaiusa commented Jul 20, 2023

can you write how to downgrade? - what commands need to be executed?
(extract lora and extract lycoris do not work)

@Boldor83
Copy link

git checkout df1a9ac

gradio needs fix then:
.\venv\Scripts\activate
pip uninstall fastapi
pip uninstall pydantic
pip install fastapi==0.99.1
pip install pydantic==1.10.11
#1129 (comment)

@astro9ine
Copy link

any resolve ? still have this issue

@islanq
Copy link

islanq commented Jul 27, 2023

The reply from @Boldor83 worked for me.

@DoguCatto
Copy link

I still have the error after going back as far as [v21.7.13)
re-installing doesn't help
Traceback (most recent call last):
File "C:\kohya\kohya_ss\kohya_ss\networks\resize_lora.py", line 9, in
from library import train_util, model_util
ModuleNotFoundError: No module named 'library'
02:08:12-166806 INFO Done resizing...

similar issues for merging and other utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants