lucidrains / denoising-diffusion-pytorch

Implementation of Denoising Diffusion Probabilistic Model in Pytorch
MIT License
8.22k stars 1.02k forks source link

'.cuda()' call in the training loop causes failure when running on CPU #8

Open Kinyugo opened 2 years ago

Kinyugo commented 2 years ago

The cuda call in the training loop

while self.step < self.train_num_steps:
    for i in range(self.gradient_accumulate_every):
        data = next(self.dl).cuda() #here
        ....

leads to cuda error when running on CPU AssertionError: Torch not compiled with CUDA enabled.

XeoOuYang commented 2 months ago

if name == 'main': //code here