zoubohao / DenoisingDiffusionProbabilityModel-ddpm-

This may be the simplest implement of DDPM. You can directly run Main.py to train the UNet on CIFAR-10 dataset and see the amazing process of denoising.
MIT License
1.48k stars 156 forks source link

question about CUDA unavailable #19

Open Z0Victor opened 1 year ago

Z0Victor commented 1 year ago

when I runMain.py , issue comes up :

RuntimeError: CUDA error: invalid device ordinal
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

how to deal with that??PLZ

AroundKiki commented 1 year ago
  1. try torch.cuda.is_available() in your python environment, it should be True.
  2. in Main.py, the default "device" params is "cuda:1", you should change it to "cuda" or "cuda:0" if you have single GPU installed.