Closed Yffy123456 closed 1 year ago
To create an instance of UnetrPPEncoder, you have to pass (dims=dims, depths=depths, num_heads=num_heads). Please pass all the required arguments.
To create an instance from the whole network, you have to do it in way similar to this one:
self.network = UNETR_PP(in_channels=self.input_channels, out_channels=self.num_classes, feature_size=16, num_heads=4, depths=[3, 3, 3, 3], dims=[32, 64, 128, 256], do_ds=True, )
if name == 'main':
/home/wf/anaconda3/envs/tr/bin/python /home/wf/yf/unetr_plus_plus-main/unetr_pp/network_architecture/acdc/unetr_pp_acdc.py Traceback (most recent call last): File "/home/wf/yf/unetr_plus_plus-main/unetr_pp/network_architecture/acdc/unetr_pp_acdc.py", line 149, in
U_PP = UNETR_PP(in_channels=1 ,out_channels=16)
File "/home/wf/yf/unetr_plus_plus-main/unetr_pp/network_architecture/acdc/unetr_pp_acdc.py", line 61, in init
self.unetr_pp_encoder = UnetrPPEncoder(dims=dims, depths=depths, num_heads=num_heads)
File "/home/wf/yf/unetr_plus_plus-main/unetr_pp/network_architecture/acdc/model_components.py", line 21, in init
get_conv_layer(spatial_dims, in_channels, dims[0], kernel_size=(1, 4, 4), stride=(1, 4, 4),
TypeError: 'NoneType' object is not subscriptable
Need some answers,Thanks