ChenDarYen / Key-Locked-Rank-One-Editing-for-Text-to-Image-Personalization

An Pytorch implementation of the paper Key-Locked Rank One Editing for Text-to-Image Personalization
MIT License
76 stars 7 forks source link

Device error #3

Closed blx0102 closed 1 year ago

blx0102 commented 1 year ago

Hi bro, I tried the code with teddy, using the command line you provide in readme, but got the device error below:

Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper_CUDA__index_select)

ChenDarYen commented 1 year ago

Hi bro, I update a new version having a single generating script. You can attempt to run the command. It works fine on my desktop, but if there is any error please let me know with the complete error message. I'll figure it out.

blx0102 commented 1 year ago

Thanks for your reply! Actually, I encountered the error when training with the command: CUDA_VISIBLE_DEVICES=7 python main.py --name teddy --base ./configs/perfusion_teddy.yaml --basedir ./ckpt -t True --gpus 0

And here is the full log when running it. tmp.log

ChenDarYen commented 1 year ago

You just miss a comma in --gpus. The correct argument should be --gpus 0,.

From line 9 in the tmp.log, pytorch Lightning detected the GPU, but didn't use it.

blx0102 commented 1 year ago

Oh! I see now, thanks mate.