索引应位于 CPU 或与被索引张量相同的设备上 (CPU)
作者: yukiime创建于 2025年5月27日更新于 2025年6月1日
在开始训练时,./stable_diffusion/ldm/models/diffusion/ddpm_edit.py 的第 1043 行 `logvar_t = self.logvar[t].to(self.device)` 会导致错误 `RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)`。 我尝试将其修改为 `logvar_t = self.logvar[t.cpu()].to(self.device)` 并可以继续运行。 我想知道是否还有其他人遇到过这个问题? 这个问题的合理解决方案是什么? 是否因为我的硬件配置导致了这个问题?
内容来源: timothybrooks/instruct-pix2pix