carefree0910 / carefree-creator

AI magics meet Infinite draw board.
https://creator.nolibox.com/guest
MIT License
2.13k stars 216 forks source link

Error when trying to run CPU mode #21

Open XplosiON1232 opened 1 year ago

XplosiON1232 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

carefree0910 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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