score-MRI icon indicating copy to clipboard operation
score-MRI copied to clipboard

A bug in device during sampling

Open Z7Gao opened this issue 1 year ago • 0 comments

Hi, I encountered a bug when running the real image sampling script.

File "xxxxx/score-MRI/sde_lib.py", line 156, in discretize self.discrete_sigmas[timestep - 1].to(t.device)) RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

a simple fix can solve this problem

adjacent_sigma = torch.where(timestep == 0, torch.zeros_like(t),
                                 self.discrete_sigmas[timestep.item() - 1].to(t.device))

Z7Gao avatar Nov 07 '23 04:11 Z7Gao