How do I set device in CUda?
This is the error i get when trying to run in gradio!
(venv) F:\OOTDiffusion\run>python gradio_ootd.py
Traceback (most recent call last):
File "F:\OOTDiffusion\run\gradio_ootd.py", line 20, in
Maybe it depends on whether your computer graphics card supports CUDA
My GPU is RTX 3060Ti and I also get above same error when run in run_ootd.py. How can i solve it? @TanvirHafiz did you sovled it?
Maybe it depends on whether your computer graphics card supports CUDA
of course my GPU has CUDA. its am nvidia 3060. anyway, upgraded to a 3090. i can try again
does not tun in 3090.there is a definite error in the coding that is stopping it!
I had the same issue. I resolved it installing cuda on my windows machine: https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local
Then installing the necessary packages in the conda env:
https://pytorch.org/get-started/locally/
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
I only one 3090 gpu card, also have a issue,
(1) update "cuda_init_.py" code in 350:
torch._C._cuda_setDevice(device) to torch._C._cuda_setDevice(0)
(2) update "torch\nn\modules\module.py" in 1144:
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
TO
return t.to(0, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
(3) update "transformers\tokenization_utils_base.py" in 790:
self.data = {k: v.to(device=device) for k, v in self.data.items()}
TO
self.data = {k: v.to(device=0) for k, v in self.data.items()}
(4) update "inference_ootd_dc.py" in 35:
self.gpu_id = 'cuda:' + str(gpu_id)
TO
self.gpu_id = 'cuda:' + str(0)
problem have solve !!