ziyangwang007/Mamba-UNet

Could you provide image processing code for 2D datasets such as ISIC2017 for fast Mamba-UNet training and testing?

GZ-YourZY opened this issue · 2 comments

Hi! Needless to say, this is an excellent job! But I'm having some troubles.
I noticed that the datasets you used are some 3D segmentation datasets, such as Synapse. I hope to use 2D images to test the model to evaluate the performance, such as ISIC 2017. Could you please expand the relevant code so that I can conduct a quick test?

Yes, i do have a plan.

I have tested for another 8 datasets, including isic. I will give you update soon. Perhaps next month.

Yes, i do have a plan.

I have tested for another 8 datasets, including isic. I will give you update soon. Perhaps next month.

I tried to use a simple UNet training code to replace the backbone with Mamba-UNet, but encountered this problem

---start load pretrained modle of swin encoder---
torch.Size([1, 992, 992])
torch.Size([1, 992, 992])
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [96,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [97,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [98,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [99,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [100,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [101,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [102,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1431,0,0], thread: [103,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [64,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [65,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [66,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [67,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [68,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [69,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [70,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [71,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [72,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [73,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [74,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [75,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [76,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [77,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [78,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [79,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [80,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [81,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [82,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [83,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [84,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [85,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [86,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [87,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [88,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [89,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [90,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [91,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [92,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [93,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [94,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [95,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [64,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [65,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [66,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [67,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [68,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [69,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [70,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [44,0,0], thread: [71,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [96,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [97,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [98,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [99,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [100,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [101,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [102,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [284,0,0], thread: [103,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [524,0,0], thread: [95,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [0,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [1,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [2,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [3,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [4,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [5,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [6,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [7,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [8,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [9,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [10,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [11,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [12,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [13,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [14,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [1298,0,0], thread: [15,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [119,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [120,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [121,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [122,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [123,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [124,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [125,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [126,0,0] Assertion target_val >= zero && target_val <= one failed.
/opt/conda/conda-bld/pytorch_1695392020201/work/aten/src/ATen/native/cuda/Loss.cu:95: operator(): block: [84,0,0], thread: [127,0,0] Assertion target_val >= zero && target_val <= one failed.

I have kept the pred and gt label sizes consistent, but I don't know where to modify further. Maybe you have a better way to solve these problems. I hope to get your help.