282857341 / nnFormer

MIT License
801 stars 85 forks source link

ask help #92

Open Yffy123456 opened 2 years ago

Yffy123456 commented 2 years ago

raceback (most recent call last): File "/home/wf/nnFormerFrame/nnFormer0/nnformer/inference/predict_simple.py", line 202, in main() File "/home/wf/nnFormerFrame/nnFormer0/nnformer/inference/predict_simple.py", line 200, in main step_size=step_size, checkpoint_name=args.chk) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/inference/predict.py", line 637, in predict_from_folder segmentation_export_kwargs=segmentation_export_kwargs) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/inference/predict.py", line 221, in predict_cases mixed_precision=mixed_precision)[1][None]) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/training/network_training/nnFormerTrainerV2_nnformer_tumor.py", line 253, in predict_preprocessed_data_return_seg_and_softmax mixed_precision=mixed_precision) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/training/network_training/nnFormerTrainer.py", line 526, in predict_preprocessed_data_return_seg_and_softmax mixed_precision=mixed_precision) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/neural_network.py", line 150, in predict_3D verbose=verbose) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/neural_network.py", line 387, in _internal_predict_3D_3Dconv_tiled gaussian_importance_map)[0] File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/neural_network.py", line 532, in _internal_maybe_mirror_and_pred_3D result_torch += 1 / num_results * pred RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 2

When i in predict have problem 529 print shape print('529',num_results,pred.shape,result_torch.shape)

529 8 torch.Size([1, 4, 64, 128, 128]) torch.Size([1, 4, 128, 128, 128])

Yffy123456 commented 2 years ago

/home/wf/anaconda3/envs/nnFormer0/bin/python /home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/nnFormer_acdc.py Traceback (most recent call last): File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/nnFormer_acdc.py", line 971, in nnF = nnFormer(crop_size=[64, 128, 128], num_classes=8) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/nnFormer_acdc.py", line 932, in init self.model_down=Encoder(pretrain_img_size=crop_size,window_size=window_size,embed_dim=embed_dim,patch_size=patch_size,depths=depths,num_heads=num_heads,in_chans=input_channels,down_stride=down_stride) File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/nnFormer_acdc.py", line 752, in init layer = BasicLayer( File "/home/wf/nnFormerFrame/nnFormer0/nnformer/network_architecture/nnFormer_acdc.py", line 495, in init self.shift_size = [window_size[0] // 2,window_size[1] // 2,window_size[2] // 2] TypeError: 'int' object is not subscriptable