ChongQingNoSubway / SelfReg-UNet

Code for the paper "SelfReg-UNet: Self-Regularized UNet for Medical Image Segmentation "
MIT License
29 stars 5 forks source link

environment #8

Closed bklee1213 closed 1 week ago

bklee1213 commented 2 weeks ago

Can you tell me the environment in which the code will run and the version of the package?

ChongQingNoSubway commented 1 week ago

Please refer to the swin-Unet and CASCADE for the training environment. Our loss was implemented by pytorch without any extra packages. https://github.com/HuCaoFighting/Swin-Unet https://github.com/SLDGroup/CASCADE

bklee1213 commented 1 week ago

Please refer to the swin-Unet and CASCADE for the training environment. Our loss was implemented by pytorch without any extra packages. https://github.com/HuCaoFighting/Swin-Unet https://github.com/SLDGroup/CASCADE

I encountered the following issues when using your test code. First, there was an error saying that the mask did not have a .shape attribute. I converted it to an array type with masks = np.array([lbl == i for i in range(1, classes)]), but then I encountered a second problem: an AssertionError occurred at assert image.shape[:2] == masks.shape[:2], stating that the image and mask should be of the same size.

bklee1213 commented 1 week ago

Please refer to the swin-Unet and CASCADE for the training environment. Our loss was implemented by pytorch without any extra packages. https://github.com/HuCaoFighting/Swin-Unet https://github.com/SLDGroup/CASCADE

I encountered the following issues when using your test code. First, there was an error saying that the mask did not have a .shape attribute. I converted it to an array type with masks = np.array([lbl == i for i in range(1, classes)]), but then I encountered a second problem: an AssertionError occurred at assert image.shape[:2] == masks.shape[:2], stating that the image and mask should be of the same size.

bklee1213 commented 1 week ago

有关培训环境,请参阅 swin-Unet 和 CASCADE。我们的损失是由 pytorch 实现的,没有任何额外的包。https://github.com/HuCaoFighting/Swin-Unet https://github.com/SLDGroup/CASCADE

我在使用您的测试代码时遇到了以下问题。首先,出现一个错误,指出掩码没有 .shape 属性。我使用 masks = np.array([lbl == i for i in range(1, classes)]) 将其转换为数组类型,但随后我遇到了第二个问题:在断言 image.shape[:2] == masks.shape[:2] 处发生 AssertionError,指出图像和掩码应该具有相同的大小。

I printed the shape and type of the image and masks. Image type: <class 'numpy.ndarray'> Image shape: (512, 512) Masks type: <class 'numpy.ndarray'> Masks shape: (8, 512, 512)"

xiwenc1 commented 1 week ago

@bklee1213 May I know if you can successfully run the codes of Swin-Uet or TransUnet?

bklee1213 commented 1 week ago

@bklee1213 May I know if you can successfully run the codes of Swin-Uet or TransUnet?

yes,I can. I commented out the code and it was ready to run