instruct-pix2pix icon indicating copy to clipboard operation
instruct-pix2pix copied to clipboard

Indices should be either on cpu or on the same device as the indexed tensor (cpu)

Open yukiime opened this issue 7 months ago • 1 comments

When starting training, line 1043 of ./stable_diffusion/ldm/models/diffusion/ddpm_edit.py logvar_t = self.logvar[t].to(self.device) will result in an error RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

I tried to fix it to logvar_t = self.logvar[t.cpu()].to(self.device) and it could be continued to run.

I wonder if anyone else has encountered this problem ? and what is the reasonable solution to this problem? Is it because of my hardware configuration that this problem is wrong?

yukiime avatar May 27 '25 01:05 yukiime

of course, I got the same problem

baihuple avatar Jun 01 '25 05:06 baihuple