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

assert x_t.shape == eps.shape #201

Open
2039551625 opened this issue Nov 5, 2024 · 13 comments
Open

assert x_t.shape == eps.shape #201

2039551625 opened this issue Nov 5, 2024 · 13 comments

Comments

@2039551625
Copy link

你好,我在对于DRIVE数据集上进行采样时,出现了这样问题,请问我该如何解决呢
Traceback (most recent call last):
File "E:\deep_learning\Segmentation\MedSegDiff-master\scripts\segmentation_sample.py", line 214, in
main()
File "E:\deep_learning\Segmentation\MedSegDiff-master\scripts\segmentation_sample.py", line 123, in main
sample, x_noisy, org, cal, cal_out = sample_fn(
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 565, in p_sample_loop_known
for sample in self.p_sample_loop_progressive(
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 650, in p_sample_loop_progressive
out = self.p_sample(
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 444, in p_sample
out = self.p_mean_variance(
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 324, in p_mean_variance
self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output)
File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 348, in _predict_xstart_from_eps
assert x_t.shape == eps.shape
AssertionError

@Coder-li-jiahao
Copy link

same question

@Coder-li-jiahao
Copy link

你好,我在对于DRIVE数据集上进行采样时,出现了这样问题,请问我该如何解决呢 Traceback (most recent call last): File "E:\deep_learning\Segmentation\MedSegDiff-master\scripts\segmentation_sample.py", line 214, in main() File "E:\deep_learning\Segmentation\MedSegDiff-master\scripts\segmentation_sample.py", line 123, in main sample, x_noisy, org, cal, cal_out = sample_fn( File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 565, in p_sample_loop_known for sample in self.p_sample_loop_progressive( File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 650, in p_sample_loop_progressive out = self.p_sample( File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 444, in p_sample out = self.p_mean_variance( File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\respace.py", line 90, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 324, in p_mean_variance self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output) File "E:\deep_learning\Segmentation\MedSegDiff-master\guided_diffusion\gaussian_diffusion.py", line 348, in _predict_xstart_from_eps assert x_t.shape == eps.shape AssertionError

same question

@2039551625
Copy link
Author

我尝试打印他们的形状,分别为x_t: torch.Size([1, 1, 64, 64]),eps: torch.Size([1, 2, 64, 64]),然后我打印出eps中的数据,发现他的两个通道的数据是一样的,所以我将eps就只取了第一通道,就跑通了

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I try to print their shapes, which are x_t: torch.Size([1, 1, 64, 64]), eps: torch.Size([1, 2, 64, 64]), and then I print out the Data, I found that the data of his two channels are the same, so I only took the first channel of eps, and it ran through.

@2039551625
Copy link
Author

但是我对于问题出现的原因,还是存有我的疑问

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


But I still have my doubts about the cause of the problem.

@Coder-li-jiahao
Copy link

但是我对于问题出现的原因,还是存有我的疑问

How is your segmentation effect? After running this experiment, I feel that the segmentation results are not as good as UNet

@Coder-li-jiahao
Copy link

我尝试打印他们的形状,分别为x_t: torch.Size([1, 1, 64, 64]),eps: torch.Size([1, 2, 64, 64]),然后我打印出eps中的数据,发现他的两个通道的数据是一样的,所以我将eps就只取了第一通道,就跑通了

My solution is the same as yours

@2039551625
Copy link
Author

但是我跑出的效果有点差
12_test_output_ens

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


But the effect I ran out was a bit poor.
12_test_output_ens

@2039551625
Copy link
Author

请问你跑的数据集上的效果怎么样

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


What is the effect on the data set you ran?

@Coder-li-jiahao
Copy link

请问你跑的数据集上的效果怎么样

My results were also very poor

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

3 participants