Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion error assert x_t.shape == eps.shape #145

Open
worthlessFella opened this issue Dec 19, 2023 · 3 comments
Open

assertion error assert x_t.shape == eps.shape #145

worthlessFella opened this issue Dec 19, 2023 · 3 comments

Comments

@worthlessFella
Copy link

Hi I have trained the segmentation code on dataset ISIC. But when I am running sample I am getting the following error. I have used all the default parameters suggested and have not made any changes to the code except few print statement for debugging:

[W socket.cpp:663] [c10d] The client socket has failed to connect to [::ffff:127.0.1.1]:56131 (system error: 10049 - The requested address is not valid in its context.).
Logging to ......\datasets\MedSegDiff\sample
creating model and diffusion...
sampling...
sample_fn False <bound method GaussianDiffusion.p_sample_loop_known of <guided_diffusion.respace.SpacedDiffusion object at 0x000002C1AD337E50>>
p_sample_loop_known
no dpm-solver
p_sample torch.Size([1, 4, 64, 64])
x torch.Size([1, 4, 64, 64])
in _predict_xstart_from_eps: x.shape, eps.shape torch.Size([1, 1, 64, 64]) torch.Size([1, 2, 64, 64])
Traceback (most recent call last):
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\scripts\segmentation_sample.py", line 207, in
main()
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\scripts\segmentation_sample.py", line 117, in main
sample, x_noisy, org, cal, cal_out = sample_fn(
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\gaussian_diffusion.py", line 569, in p_sample_loop_known
for sample in self.p_sample_loop_progressive(
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\gaussian_diffusion.py", line 654, in p_sample_loop_progressive
out = self.p_sample(
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\gaussian_diffusion.py", line 447, in p_sample
out = self.p_mean_variance(
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\gaussian_diffusion.py", line 329, in p_mean_variance
self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output)
File "C:\Users\bdebnath\data\myprojects\MedSegDiff\guided_diffusion\gaussian_diffusion.py", line 350, in _predict_xstart_from_eps
assert x_t.shape == eps.shape
AssertionError

@FionaYeager
Copy link

I also encountered the same problem. Have you resolved this bug now?

@luisfernandes9
Copy link

I am having the same problem as well

@linyuanwang
Copy link

I have encountered the same problem. Has anyone solved it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants