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

CPU support for test.py #7

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

CPU support for test.py #7

wants to merge 5 commits into from

Conversation

DrSleep
Copy link

@DrSleep DrSleep commented Mar 30, 2022

This PR makes test.py runnable without a CUDA device -- by default, if CUDA is not found it will use torch.device("CPU").
If CUDA is not found, but requested -- it will print a warning message.
If CUDA is found but not requested -- it will also print a warning message as before.

Testing: Tested locally on MacBook without GPU

python test.py --name anime_style --dataroot examples/test

@krummrey
Copy link

krummrey commented May 3, 2022

Works for me. Thanks a lot.

@krummrey
Copy link

I just tried the new MPS option in PyTorch and it ran even a little faster with the original .pth model

device = torch.device("mps" if torch.backends.mps.is_available() else "cpu")

Tested 500 images in:
CPU 123 sec
MPS 30 sec
CoreML 32 sec

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

Successfully merging this pull request may close these issues.

None yet

2 participants