ge-xing / Diff-UNet

Diff-UNet: A Diffusion Embedded Network for Volumetric Segmentation. (using diffusion for 3D medical image segmentation)
Apache License 2.0
155 stars 22 forks source link

The reason why the author's results cannot be reproduced #32

Open ZhengChen6 opened 8 months ago

ZhengChen6 commented 8 months ago

作者您好! 我猜测在issue种很多人无法复现您的结果是因为您在您的代码种用os.listdir获得目录然后再划分训练集和测试集,一旦更换主机,os.listdir得到的文件的顺序是不一样的,所以我们最终划分的数据集和您的数据集是不一样的。我分别尝试在两台主机上打印os.listdir获得的目录顺序,发现其不一致。 image

主机一: image

主机二: image

我建议您对os.listdir后的all_dirs进行排序后再划分数据集!

I guess that many people in the issue cannot reproduce your results because you use os.listdir in your code to obtain the dirs and then divide the training set and test set. Once the host is changed, the order of the files obtained by os.listdir is not the same. The same, so the data set we finally divided is different from your data set. I tried to print the directory order obtained by os.listdir on the two hosts and found that it was inconsistent. @ge-xing

ge-xing commented 8 months ago

Thank you~

zz973 commented 4 months ago

作者您好如何编写代码保存模型的预测分割图,我看你是有写到图片保存函数的但是你没有调用

ge-xing commented 4 months ago

validation_step 里面 得到预测结果以后,调用sitk的函数保存为nii gz文件就行