xmindflow / deformableLKA

[WACV 2024] Beyond Self-Attention: Deformable Large Kernel Attention for Medical Image Segmentation
https://arxiv.org/abs/2309.00121
157 stars 12 forks source link

Pancreas code loading state_dict for D_LKA_Net error #8

Closed ai1808328 closed 7 months ago

ai1808328 commented 7 months ago

I followed all the steps you have including downloading the same Python and PyTorch versions for running the pancreas code.

The train_pancreas.py ran well and the weights were saved as intended. However, I am getting an error when running the test_pancreas.py and I cannot seem to fix it.

image (1) image (2)

Leonngm commented 7 months ago

Hi, thanks for your interest in our code.

Could you share the create model function of the train_pancreas.py script and the create model function for your test_pancreas.py script?

Leonngm commented 7 months ago

I think I got your error:

In _testpancreas.py please replace net = D_LKA_Net(in_channels=1, out_channels=num_classes, img_size=[96, 96, 96], patch_size=(2,2,2), input_size=[48*48*48, 24*24*24,12*12*12,6*6*6], trans_block=Transformerblock, do_ds=False)

with: net = D_LKA_Net(in_channels=1, out_channels=num_classes, img_size=[96, 96, 96], patch_size=(2,2,2), input_size=[48*48*48, 24*24*24,12*12*12,6*6*6], trans_block=TransformerBlock_3D_single_deform_LKA, do_ds=False)

ai1808328 commented 7 months ago

Thank you!