Scatteredrain / SALI

[MICCAI 2024] SALI: Short-term Alignment and Long-term Interaction Network for Colonoscopy Video Polyp Segmentation
https://arxiv.org/abs/2406.13532
MIT License
24 stars 0 forks source link

Hi, I'm getting an error in the second epoch of the reproduction process:AttributeError: 'NoneType' object has no attribute 'shape' #4

Open TJTwonderfulday opened 4 days ago

TJTwonderfulday commented 4 days ago

[Train Info]: Epoch [002/030], Loss_AVG: 3.8598 0%| | 0/3882 [00:00<?, ?it/s]type of mk :<class 'NoneType'> type of qk :<class 'torch.Tensor'> 0%| | 0/3882 [00:00<?, ?it/s] Traceback (most recent call last): File "/root/autodl-tmp/SALI-main/train_video.py", line 294, in val(val_loader, model, epoch, save_path, writer, opt.mem_freq) File "/root/autodl-tmp/SALI-main/train_video.py", line 163, in val res= model(images,[case_idx],mode='val', use_mem=True, add_mem=True)[-1] File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/root/autodl-tmp/SALI-main/lib/model.py", line 241, in forward out = self.val_longshort(x, case_idx=case_idx, gt_mem=gt_mem, use_mem=use_mem, add_mem=add_mem) File "/root/autodl-tmp/SALI-main/lib/model.py", line 299, in val_longshort corr_vol_mem = self.mem_bank.match_memory(keyQ,valueQ) File "/root/autodl-tmp/SALI-main/lib/long_term.py", line 110, in match_memory affinity = self._global_matching(key_mem, key_query.flatten(start_dim=-2)) File "/root/autodl-tmp/SALI-main/lib/long_term.py", line 67, in _global_matching B, CK, NE = mk.shape
AttributeError: 'NoneType' object has no attribute 'shape'

Scatteredrain commented 4 days ago

hello, did your training and testing for the first epoch run successfully?

TJTwonderfulday commented 4 days ago

hello, did your training and testing for the first epoch run successfully?

Yes, the first epoch can be trained and tested in its entirety. But by the second epoch training is possible with normal training and testing with this error. (It is also possible to train all epochs normally if you remove the val process)