yuval-alaluf / SAM

Official Implementation for "Only a Matter of Style: Age Transformation Using a Style-Based Regression Model" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02754
https://yuval-alaluf.github.io/SAM/
MIT License
632 stars 151 forks source link

Run SAM on CPU #47

Closed minhtcai closed 2 years ago

minhtcai commented 2 years ago

Hi, what are the changes I need to make to run this on CPU? Thank you very much! I've tried use 'cpu' instead of 'cuda', but I got this error while importing pSp: ImportError: /root/.cache/torch_extensions/py37_cu113/fused/fused.so: cannot open shared object file: No such file or directory

yuval-alaluf commented 2 years ago

You will need to replace the usage of the CUDA kernels that are used by default with a native implementation. I hope the following thread can help: https://github.com/rosinality/stylegan2-pytorch/issues/89

minhtcai commented 2 years ago

Thank you, I got it up and run, making a pull request soon!

omegascorp commented 1 year ago

@minhtcai could you share your version that runs on CPU?