a312863063 / SimSwapHD

Reimplement of SimSwap training code
Other
171 stars 47 forks source link

For Mac Users or people with Issues with CUDA #40

Closed kambiannan closed 1 year ago

kambiannan commented 1 year ago

If you are getting this error raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

20c20
<         self.mean = torch.from_numpy(self.mean).float().cuda()
---
>         self.mean = torch.from_numpy(self.mean).float().to(torch.device('cuda:0' if torch.cuda.is_available() else 'cpu'))
24c24
<         self.std = torch.from_numpy(self.std).float().cuda()
---
>         self.std = torch.from_numpy(self.std).float().to(torch.device('cuda:0' if torch.cuda.is_available() else 'cpu'))
52c52
<         device = torch.device("cuda:0")
---
>         device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
60c60
<         netArc_checkpoint = torch.load(netArc_checkpoint)
---
>         netArc_checkpoint = torch.load(netArc_checkpoint) if torch.cuda.is_available() else torch.load(netArc_checkpoint, map_location=torch.device('cpu'))

Attaching file. Just put in models. fs_model.py.zip

kambiannan commented 1 year ago

any other issues, reply here. I can try to assist