JuliaWolleb / Diffusion-based-Segmentation

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

I ran into a problem when running segmentation_sample.py. #9

Closed jaceqin closed 1 year ago

jaceqin commented 1 year ago

Traceback (most recent call last): File "scripts/segmentation_sample.py", line 125, in main() File "scripts/segmentation_sample.py", line 97, in main model_kwargs=model_kwargs, File "./guided_diffusion/gaussian_diffusion.py", line 524, in p_sample_loop_known progress=progress, File "./guided_diffusion/gaussian_diffusion.py", line 586, in p_sample_loop_progressive model_kwargs=model_kwargs, File "./guided_diffusion/gaussian_diffusion.py", line 433, in p_sample model_kwargs=model_kwargs, File "./guided_diffusion/respace.py", line 90, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "./guided_diffusion/gaussian_diffusion.py", line 310, in p_mean_variance self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output) File "./guided_diffusion/gaussian_diffusion.py", line 331, in _predict_xstart_from_eps assert x_t.shape == eps.shape AssertionError

JuliaWolleb commented 1 year ago

Could you print _xt.shape and eps.shape in the indicated line?

jaceqin commented 1 year ago

eps.shape=torch.Size([1, 2, 224, 224]);x_t.shape=torch.Size([1, 1, 224, 224])

jaceqin commented 1 year ago

Do you know why eps.shape and x_t.shape are differen?I use your data and code.

JuliaWolleb commented 1 year ago

what is your "learn_sigma" flag? did you set it to True or False?

jaceqin commented 1 year ago

learn_sigma is False

JuliaWolleb commented 1 year ago

ok, try to set all flags according to the README file. There, we have learn_sigma=True

jaceqin commented 1 year ago

OK.Thank you!