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

Is it possible to run inference on cpu? #18

Closed
justmaulik opened this issue Oct 24, 2020 · 4 comments
Closed

Is it possible to run inference on cpu? #18

justmaulik opened this issue Oct 24, 2020 · 4 comments

Comments

@justmaulik
Copy link

I tried it to make it work(with beginner knowledge) but I keep getting different errors.

@yuval-alaluf
Copy link
Collaborator

Hi @justmaulik
This may be possible, but it may be challenging to make the changes to the code as ninja requires CUDA.
However, if you plan on only running inference (and don't have access to a GPU), maybe running on Google colab will suit your needs.
In case you missed it, we have a Google colab linked in the README that can help you get started.

@justmaulik
Copy link
Author

I already tried on colab and also modified some of the code(few lines) where it required CUDA but it's more complex than just a few lines. and I can train it on GPU but I am planning to host inference as API so CPU is the only way the fits my budget.

Replacing ninja to support CPU inference is anywhere on the to-do list? :) or you could just point me in a direction what I need to do to run just the inference on CPU.

@yuval-alaluf
Copy link
Collaborator

If I had to guess, you're probably getting an exception when trying to load the FusedLeakyReLU?
We are not sure when we will have time to add CPU inference support, but you may find the following issue from rosinality helpful:
rosinality/stylegan2-pytorch#89
The commit linked in the issue above should be a good starting point, but some more modifications will most likely be needed.

@justmaulik
Copy link
Author

Thanks @yuval-alaluf

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