xtts2-ui icon indicating copy to clipboard operation
xtts2-ui copied to clipboard

AssertionError: Torch not compiled with CUDA enabled

Open 0wwafa opened this issue 1 year ago • 2 comments

I did everything in the README. (I am using CPU only)

When running python app.py I get: AssertionError: Torch not compiled with CUDA enabled

0wwafa avatar Jun 06 '24 09:06 0wwafa

According to stackoverflow:

You are using CPU only pytorch, but your code has statement like cr = nn.CrossEntropyLoss(weight=torch.tensor(classes_weights).cuda()) which is trying to move the tensor to GPU.

To fix it, remove all the .cuda() operations.

0wwafa avatar Jun 06 '24 09:06 0wwafa

If you change this line to device = torch.device('cpu') it'll work.

markusbkk avatar Aug 21 '24 10:08 markusbkk