MedSegDiff icon indicating copy to clipboard operation
MedSegDiff copied to clipboard

important code error: losses["loss"].detach() in train_util.py line 246

Open Frank21st opened this issue 1 year ago • 4 comments

please check the losses variable

        if isinstance(self.schedule_sampler, LossAwareSampler):
            self.schedule_sampler.update_with_local_losses(
                t, losses["loss"].detach()
            )
        losses = losses1[0]
        sample = losses1[1]

B

Frank21st avatar Feb 27 '23 03:02 Frank21st

I met the same situation. Do you know how to solve it now?

heha102 avatar Mar 03 '23 13:03 heha102

waiting for the author to reply...

Frank21st avatar Apr 01 '23 07:04 Frank21st

you can simply put line 248 in front of it. actually this block will not be run in the current version

WuJunde avatar Apr 01 '23 08:04 WuJunde

losses["loss"].detach() ---> losses1[0].detach() ?

Frank21st avatar Apr 01 '23 08:04 Frank21st