AndyCao1125 / SDDPM

[WACV 2024] Spiking Denoising Diffusion Probabilistic Models
30 stars 3 forks source link

RuntimeError #2

Closed weiruchess closed 3 months ago

weiruchess commented 6 months ago

Hello author,

Thank you for your code. However, I encountered the following error when running the program with the command "CUDA_VISIBLE_DEVICES=0 python main_SDDPM.py --train":

RuntimeError: The size of tensor a (64) must match the size of tensor b (32) at non-singleton dimension 0.

But when I set "total_steps" to 1, the error disappears. I hope to get your explanation or solution for this issue.

Thank you!

AndyCao1125 commented 5 months ago

Thanks for your question. If you hope to use one GPU to train the SDDPM, one solution to prevent this error is to make sure that _args.batchsize is equal to _args.samplesize, and set args.parallel = False. But we strongly recommand to use muli-GPUs, e.g., _CUDA_VISIBLE_DEVICES=0,1 python mainSDDPM.py --train --parallel=True.