Giter VIP home page Giter VIP logo

Comments (7)

chenyu1330 avatar chenyu1330 commented on July 29, 2024 1

Why is it that the result of my last training in BraTS is a MRI diagram?

from medsegdiff.

iYeekk avatar iYeekk commented on July 29, 2024

I run the segmentation_sample.py, and meet the problem:

Logging to /root/autodl-tmp/MedSegDif/med_results/img_out/ creating model and diffusion... sampling... no dpm-solver /root/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:1709: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "MedSegDif/med_scripts/segmentation_sample.py", line 163, in main() File "MedSegDif/med_scripts/segmentation_sample.py", line 109, in main sample, x_noisy, org, cal, cal_out = sample_fn( File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/gaussian_diffusion.py", line 553, in p_sample_loop_known for sample in self.p_sample_loop_progressive( File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/gaussian_diffusion.py", line 624, in p_sample_loop_progressive out = self.p_sample( File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/gaussian_diffusion.py", line 435, in p_sample out = self.p_mean_variance( File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/respace.py", line 90, in p_mean_variance return super().p_mean_variance(self._wrap_model(model), *args, **kwargs) File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/gaussian_diffusion.py", line 319, in p_mean_variance model_mean, _, _ = self.q_posterior_mean_variance( File "/root/autodl-tmp/./MedSegDif/med_guided_diffusion/gaussian_diffusion.py", line 219, in q_posterior_mean_variance assert x_start.shape == x_t.shape AssertionError

I know that it is because x_start.shape is not equal to x_t.shape. However, My dataset is similar to ISICDataset, so I feel very strange. Thanks a lot if you can reply.

Have you solved it? I have the same doubt, thanks!

from medsegdiff.

jojo803 avatar jojo803 commented on July 29, 2024

Have you figure it out? I have the same question...

from medsegdiff.

WuJunde avatar WuJunde commented on July 29, 2024

could you print x_start.shape and x_t.shape?

from medsegdiff.

jojo803 avatar jojo803 commented on July 29, 2024

I try to print x_start.shape and x_t.shape however there is an error occurred before I can get x_start.

Traceback (most recent call last):
File "F:\dpm\MedSegDiff-master-v2\v2\scripts\segmentation_sample.py", line 194, in
main()
File "F:\dpm\MedSegDiff-master-v2\v2\scripts\segmentation_sample.py", line 116, in main
sample, x_noisy, org, cal, cal_out = sample_fn(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 566, in p_sample_loop_known
for sample in self.p_sample_loop_progressive(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 651, in p_sample_loop_progressive
out = self.p_sample(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 446, in p_sample
out = self.p_mean_variance(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 325, in p_mean_variance
self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output)
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 350, in _predict_xstart_from_eps
assert x_t.shape == eps.shape
AssertionError

I print x_t.shape and eps.shape, and result is like this:
x_t.shape= torch.Size([1, 1, 64, 64])
eps.shape= torch.Size([1, 2, 64, 64])

I suppose to use the right dataset step by step in Readme.md. The eps[:, 0, :, :] is totally the same as eps[:, 1; :, :]. After clipping eps to [1,1,64,64] by deleting either of them, program can work. I can't understand why their shapes are not consistant. Therefore, I can't figure out whether I can get the right answer by simple clipping conducted by myself without theory support.

from medsegdiff.

rrrrrrrrrice avatar rrrrrrrrrice commented on July 29, 2024

I try to print x_start.shape and x_t.shape however there is an error occurred before I can get x_start.

Traceback (most recent call last):
File "F:\dpm\MedSegDiff-master-v2\v2\scripts\segmentation_sample.py", line 194, in
main()
File "F:\dpm\MedSegDiff-master-v2\v2\scripts\segmentation_sample.py", line 116, in main
sample, x_noisy, org, cal, cal_out = sample_fn(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 566, in p_sample_loop_known
for sample in self.p_sample_loop_progressive(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 651, in p_sample_loop_progressive
out = self.p_sample(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 446, in p_sample
out = self.p_mean_variance(
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\respace.py", line 90, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 325, in p_mean_variance
self._predict_xstart_from_eps(x_t=x, t=t, eps=model_output)
File "F:\dpm\MedSegDiff-master-v2\v2\scripts..\guided_diffusion\gaussian_diffusion.py", line 350, in _predict_xstart_from_eps
assert x_t.shape == eps.shape
AssertionError

I print x_t.shape and eps.shape, and result is like this: x_t.shape= torch.Size([1, 1, 64, 64]) eps.shape= torch.Size([1, 2, 64, 64])

I suppose to use the right dataset step by step in Readme.md. The is totally the same as . After clipping eps to by deleting either of them, program can work. I can't understand why their shapes are not consistant. Therefore, I can't figure out whether I can get the right answer by simple clipping conducted by myself without theory support.eps[:, 0, :, :]``eps[:, 1; :, :]``[1,1,64,64]

Hello! I have encountered a type-related issue with the ISIC dataset. Specifically, I'm getting the following error:

"assert x_t.shape == eps.shape
AssertionError"

Could you please help me identify which line of code needs to be modified to make the project run successfully?

from medsegdiff.

zzh1230 avatar zzh1230 commented on July 29, 2024

Has it been resolved? I encountered the same problem

from medsegdiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.