askerlee / segtran

Medical Image Segmentation using Squeeze-and-Expansion Transformers
214 stars 50 forks source link

patch size #13

Closed wshi8 closed 3 years ago

wshi8 commented 3 years ago

I would like to try a smaller patch size (orig_patch_size) such as (80,80,80) so that I could possibly increase the batch_size to 2. It gave this error, any advice? Traceback (most recent call last): File "train3d.py", line 781, in outputs = net(volume_batch) File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/ubuntu/segtran/code/networks/segtran3d.py", line 488, in forward feats_dict = self.backbone.extract_features(fakeRGB_batch) File "/home/ubuntu/segtran/code/networks/aj_i3d/aj_i3d.py", line 331, in extract_features pooled_feat = self.avg_pool(x) File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "/home/ubuntu/anaconda3/envs/pytorch_latest_p37/lib/python3.7/site-packages/torch/nn/modules/pooling.py", line 701, in forward self.padding, self.ceil_mode, self.count_include_pad, self.divisor_override) RuntimeError: input image (T: 10 H: 5 W: 5) smaller than kernel size (kT: 2 kH: 7 kW: 7)

askerlee commented 3 years ago

Sorry for the late reply. I debugged a little bit. Seems the smallest input height and width to i3d is 16*7=112. You could use a smaller depth, e.g. 64. So (112, 112, 64) is legal but (80, 80, 80) is not.