Closed islandLZ closed 1 year ago
When I change n_channels = 3 , I meet an other erro!
Hi @islandLZ. The problem seems to be the last version of the architecture was strictly designed to be 3d while your inputs are 2d. I've just committed a version of the architecture with a 'dim' argument with '2d' or '3d' inputs. Give that a try and see if it works for you.
I set this:
class MedNeXt(nn.Module):
def __init__(self,
in_channels: int = 3,
n_channels: int = 32,
n_classes: int = 3,
exp_r: list = [3,4,8,8,8,8,8,4,3], # Expansion ratio as in Swin Transformers
kernel_size: int = 5, # Ofcourse can test kernel_size
enc_kernel_size: int = None,
dec_kernel_size: int = None,
deep_supervision: bool = False, # Can be used to test deep supervision
do_res: bool = True, # Can be used to individually test residual connection
do_res_up_down: bool = True, # Additional 'res' connection on up and down convs
checkpoint_style: str = 'outside_block', # Either inside block or outside block
block_counts: list = [3,4,8,8,8,8,8,4,3], # Can be used to test staging ratio:# [3,3,9,3] in Swin as opposed to [2,2,2,2,2] in nnUNet
norm_type = 'group',
):
....... then I have made modifications to my data format: [1,3,512,512] -> [1,3,64,64,64]
So that the network can operate normally.
But I am still testing whether this method is feasible。
Hi @islandLZ. The problem seems to be the last version of the architecture was strictly designed to be 3d while your inputs are 2d. I've just committed a version of the architecture with a 'dim' argument with '2d' or '3d' inputs. Give that a try and see if it works for you.
Thank you for your work. I will try the 'dim' you just set up now。
I success
Hi @islandLZ. The problem seems to be the last version of the architecture was strictly designed to be 3d while your inputs are 2d. I've just committed a version of the architecture with a 'dim' argument with '2d' or '3d' inputs. Give that a try and see if it works for you.
Your work has been successful.
I'm glad to hear that it helped!
The data format read by my data loader is torch.Size([1, 3, 512, 512]).
I encountered an error here。
So how should I set the initial parameters of the entire network?
When I put in_ A new error occurred when in_channels were set to 1: