JuliaWolleb / Diffusion-based-Segmentation

This is the official Pytorch implementation of the paper "Diffusion Models for Implicit Image Segmentation Ensembles".
MIT License
279 stars 36 forks source link

on running the train.py comes KeyError: 'vb'? how to solve this? #2

Closed txchen-USTC closed 11 months ago

txchen-USTC commented 2 years ago

Setting up a new session... Setting up a new session... Setting up a new session... Logging to ./results creating model and diffusion... creating data loader... training... Traceback (most recent call last): File "scripts/segmentation_train.py", line 89, in main() File "scripts/segmentation_train.py", line 62, in main lr_anneal_steps=args.lr_anneal_steps, File "./guided_diffusion/train_util.py", line 189, in run_loop self.run_step(batch, cond) File "./guided_diffusion/train_util.py", line 214, in run_step lossseg, losscls, lossrec, sample = self.forward_backward(batch, cond) File "./guided_diffusion/train_util.py", line 260, in forward_backward losscls = (losses["vb"] * weights).mean().detach() KeyError: 'vb'

JuliaWolleb commented 2 years ago

Hi Have you set the flat --learn_sigma True? Then, losses["vb"] should not give any key error.

I just updated the file "./guided_diffusion/train_util.py", becuase the loss terms "losscls, lossreg, lossseg" are not used anymore. Let me know if it works now.

txchen-USTC commented 2 years ago

do you have a pretrained model on BRATS2020?

MuqinZ commented 1 year ago

Can you give me your E-mail. I want to talk about this Net-Model with you.