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

Error when trying to run CPU mode #21

Open
XplosiON1232 opened this issue Mar 9, 2023 · 9 comments
Open

Error when trying to run CPU mode #21

XplosiON1232 opened this issue Mar 9, 2023 · 9 comments

Comments

@XplosiON1232
Copy link

Hello!
I might be totally lost but I'm trying to run it on a google cloud server. It doesn't have any GPU, so I'm trying to run the project in CPU mode using cfcreator serve --cpu. When I do so I get the following error:

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Application startup failed. Exiting.

Can someone please help me? Thanks a lot :)

@carefree0910
Copy link
Owner

oh, it's my fault, seems that i've saved some state_dict with device=cuda... I'll look into it and try to fix it ASAP!

@XplosiON1232
Copy link
Author

oh, it's my fault, seems that i've saved some state_dict with device=cuda... I'll look into it and try to fix it ASAP!

Thanks! Please let me know if you fix it 😄

@carefree0910
Copy link
Owner

oh, it's my fault, seems that i've saved some state_dict with device=cuda... I'll look into it and try to fix it ASAP!

Thanks! Please let me know if you fix it 😄

I tried to fix it but I have not tested it yet, would you please run it again on your cloud server to see if everything goes right? 😆

@XplosiON1232
Copy link
Author

oh, it's my fault, seems that i've saved some state_dict with device=cuda... I'll look into it and try to fix it ASAP!

Thanks! Please let me know if you fix it 😄

I tried to fix it but I have not tested it yet, would you please run it again on your cloud server to see if everything goes right? 😆

Hmm.. I just tested but I couldn't get it to work, I reinstalled my vm and installed by pip and then cloning the git, but I get the exact same error...

@carefree0910
Copy link
Owner

That's weird... I'll build up a env without cuda support to see what is going on then. 😣

@carefree0910
Copy link
Owner

Hi! Turns out that there are still SOME weights that are located on cuda. (I only checked the FIRST weight before. 🤣)

Now at least I can get everything running on my mac, hope it works for your cloud server!

@XplosiON1232
Copy link
Author

Hi!
I might be doing something wrong, but now I get this error:

xplosion_now@carefree2:~$ cfcreator serve --cpu
> init sd_v1.5
Killed

@carefree0910
Copy link
Owner

OK! This is what I know: currently this service has VERY MANY models, so your RAM should be large enough (maybe at least 64GB, 100GB will be better!)

If you don't have that much RAM, you can try to add a focus flag, for instance:

cfcreator serve --cpu --focus sd.base

Which will only load a subset of the available models!

@XplosiON1232
Copy link
Author

Awh, I got the same message, just says "Killed" after "init sd_v1.5". I might try the Google Colab version instead! Thank you :)

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

2 participants