Closed zhao9chen99999 closed 1 year ago
self.embed_model = BasicUNetEncoder(3, 4, 2, [64, 64, 128, 256, 512, 64])
self.model = BasicUNetDe(3, 7, 3, [64, 64, 128, 256, 512, 64], act = ("LeakyReLU", {"negative_slope": 0.1, "inplace": False}))
The second parameter of the two model is 4 and 7, respectively. If your dataset have 1 modality and 2 segmentation targets, you can modify the two number 4, 7 -> 1, 3. And the third parameter of BasicUNetDe is the number of segmentation targets. For example:
self.embed_model = BasicUNetEncoder(3, 1, 2, [64, 64, 128, 256, 512, 64])
self.model = BasicUNetDe(3, 3, 2, [64, 64, 128, 256, 512, 64], act = ("LeakyReLU", {"negative_slope": 0.1, "inplace": False}))
self.embed_model = BasicUNetEncoder(3, 4, 2, [64, 64, 128, 256, 512, 64])
self.model = BasicUNetDe(3, 7, 3, [64, 64, 128, 256, 512, 64], act = ("LeakyReLU", {"negative_slope": 0.1, "inplace": False}))
The second parameter of the two model is 4 and 7, respectively. If your dataset have 1 modality and 2 segmentation targets, you can modify the two number 4, 7 -> 1, 3. And the third parameter of BasicUNetDe is the number of segmentation targets. For example:
self.embed_model = BasicUNetEncoder(3, 1, 2, [64, 64, 128, 256, 512, 64])
self.model = BasicUNetDe(3, 3, 2, [64, 64, 128, 256, 512, 64], act = ("LeakyReLU", {"negative_slope": 0.1, "inplace": False}))
thanks for your answer!! my datasets have 1 modality and 1 segmentation targets(wt),does that means i need to adjust like: self.embed_model = BasicUNetEncoder(3, 1, 1, [64, 64, 128, 256, 512, 64])
self.model = BasicUNetDe(3, 2, 1, [64, 64, 128, 256, 512, 64],
Yes.
Yes. i adjusted like this:
![]()
but i got this error report
![]()
Did you solve this problem?
You need to modify the dataset related codes to construct the right inputs. You can print the shape in this section:
And
sample_out = self.sample_diffusion.ddim_sample_loop(self.model, (1, 3, 96, 96, 96), model_kwargs={"image": image, "embeddings": embeddings}) The second parameter is (1, 3, 96, 96, 96), you may need to modify the 3 to 1 if your segmentation target number is 1.
you need to look the code at brats_data_utils_multi_label. as # transforms.ConvertToMultiChannelBasedOnBratsClassesD(keys=["label"]),
You need to modify the dataset related codes to construct the right inputs. You can print the shape in this section:
![]()
And
sample_out = self.sample_diffusion.ddim_sample_loop(self.model, (1, 3, 96, 96, 96), model_kwargs={"image": image, "embeddings": embeddings}) The second parameter is (1, 3, 96, 96, 96), you may need to modify the 3 to 1 if your segmentation target number is 1.
thx for you advice!!i'll try on that!!!
you need to look the code at brats_data_utils_multi_label. as # transforms.ConvertToMultiChannelBasedOnBratsClassesD(keys=["label"]),
thx for that,i'll have a try!
you need to look the code at brats_data_utils_multi_label. as # transforms.ConvertToMultiChannelBasedOnBratsClassesD(keys=["label"]),
thx for that,i'll have a try!
Hi! Do you successfully run the train.py after modify the input channel?
You can see the BTCV dir, which has the single-channel input.
You can see the BTCV dir, which has the single-channel input.
Thanks for your reply.But I think I don't catch your meaning.
https://github.com/ge-xing/Diff-UNet/blob/main/BTCV/train.py
This file contains the example of single-channel input.
https://github.com/ge-xing/Diff-UNet/blob/main/BTCV/train.py
This file contains the example of single-channel input.
hello, I find it the train results of my own dataset are not good, and the test out is not correct.
I have already received your e-mail,Thanks a lot!我已收到您发送的邮件,感谢您的来信!
https://github.com/ge-xing/Diff-UNet/blob/main/BTCV/train.py
This file contains the example of single-channel input.
I don't know why the valdation process takes so long...
https://github.com/ge-xing/Diff-UNet/blob/main/BTCV/train.py
This file contains the example of single-channel input.
I modify this :
the result is not ideal.
You can contact with me on the wechat: 18340097191. Thank you!
Hello, your work is so great!! i ve already got the results on brats2020,now iam work on my own datasets,but my dataset only have 1 modality (t1),i want to know where can i change the input channel from 4 to 1 ,and what else do i need to change,thx!!!!