Uh oh!
There was an error while loading. Please reload this page.
Allow for using CPU if no CUDA device is detected - #123
Conversation
leszekhanusz
left a comment
There was a problem hiding this comment.
Thanks, it works!
It is my understanding that by default, pytorch puts everything on the cpu and you have to specify .cuda() or .to(torch.device("cuda") to move things to the gpu.
So I think that maybe all the model.cpu() calls are not needed. Same for .to(torch.device("cpu"))
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently I am using It would be neat if we could use a This would be useful for example when you have a GPU but not not enough VRAM to put the model on it. |
Urcra
commented
Aug 18, 2022
👍 Yeah you are right, just didn't think about that when I first made the PR, but I fixed it now, so it's a bit cleaner |
Urcra
commented
Aug 18, 2022
Wanted to also do this, but it's pretty annoying to pass new arguments into the classes from |
Code changes from CompVis/latent-diffusion#123
Allows for running on the CPU if no CUDA device is detected instead of just giving a runtime error.
This should allow for more people to experiment even without owning an nvidia GPU
Solves:
cpu()#118