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

Can't use in colab? #14

Open
User1231300 opened this issue Nov 25, 2022 · 5 comments
Open

Can't use in colab? #14

User1231300 opened this issue Nov 25, 2022 · 5 comments

Comments

@User1231300
Copy link

I installed torch==1.11.0

when trying to merge i get this

Using half precision

---------------------
     ITERATION 1
---------------------

new alpha = 0.05

FINDING PERMUTATIONS
P_bg337: -0.5
P_bg324: -0.5
P_bg358: -0.125
P_bg324: 0.5
0.42857142857142855

---------------------
     ITERATION 2
---------------------

new alpha = 0.05263157894736836

FINDING PERMUTATIONS
P_bg358: 0.0625
P_bg337: 1.0
^C

How to fix?

@ogkalu2
Copy link
Owner

ogkalu2 commented Nov 26, 2022

Hi that looks like you ran out of memory. Try the new commit. It's optimized. See if it works now

@User1231300
Copy link
Author

It's not working. Can you add a clear list of requirements?

@ogkalu2
Copy link
Owner

ogkalu2 commented Nov 28, 2022

Really the only requirement is

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113

@R-N
Copy link

R-N commented Feb 23, 2023

I'm having the same issue on Google Colab, but worse. It crashes right away at first iteration.

/content/merger
Using half precision

    ---------------------
         ITERATION 1
    ---------------------
    
new alpha = 0.045

^C

Code:

!pip install pytorch-lightning torch==1.11.0+cu113 torchvision==0.12.0+cu113 

!git clone https://github.com/ogkalu2/Merge-Stable-Diffusion-models-without-distortion merger
%cd /content/merger

#download models from hf
!curl ...

model_a_path = "novelai.ckpt"
model_b_path = "sd_1.5.ckpt"
output_name = f"NAI_f222_0.45ws.ckpt"
alpha = 0.45

%cd /content/merger
!python SD_rebasin_merge.py --model_a {model_a_path} --model_b {model_b_path} --output {output_name} --alpha {alpha}

They're both 4GB checkpoints (fp32). Here's RAM usage:
image

By the way it seems to need one more requirement: pytorch-lightning
EDIT: Nvm, it's required by the checkpoint pickle

Anyway, I'll try using GPU

@R-N
Copy link

R-N commented Feb 23, 2023

I'm getting an error with GPU but I think it's progressing. I guess it was indeed RAM issue.

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

3 participants