Tramac / Fast-SCNN-pytorch

A PyTorch Implementation of Fast-SCNN: Fast Semantic Segmentation Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

runtime error while running eveal.py on voc datasets

GUESSVPN opened this issue · comments

Hi,Thanks for your work.I have adapted the data_loder file of VOC from your another repo https://github.com/Tramac/awesome-semantic-segmentation-pytorch to train the VOC data.But when I went to the validation step after my training, I met the runtime error as following:

Namespace(aux=False, aux_weight=0.4, base_size=520, batch_size=2, crop_size=480, dataset='pascal_voc', device=device(type='cuda', index=0), epochs=160, eval=False, lr=0.01, model='fast_scnn', momentum=0.9, no_val=True, resume=None, save_folder='./weights', start_epoch=0, train_split='train', weight_decay=0.0001) Found 1449 images in the folder ./datasets/voc/VOC2012 Finished loading model! Testing model: fast_scnn Traceback (most recent call last): File "eval.py", line 62, in <module> evaluator.eval() File "eval.py", line 43, in eval outputs = self.model(image) File "/home/eli/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/eli/Fast-scnn_voc/models/fast_scnn.py", line 37, in forward x = self.feature_fusion(higher_res_features, x) File "/home/eli/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/eli/Fast-scnn_voc/models/fast_scnn.py", line 213, in forward out = higher_res_feature + lower_res_feature RuntimeError: The size of tensor a (63) must match the size of tensor b (64) at non-singleton dimension 3
Is there any suggestion to solve this problem? Thanks.

Maybe because of the input size.

Thanks a lot. So how should I change the crop_size of the input images?

What is the current input size?

The crop-size is now 480,and I did have change it to 512, 500 or any others, but it doesn't work. Is there any trouble with the transforms.Normalize parameters? the current parameters is [.485, .456, .406], [.229, .224, .225]

Hi, there.I found the problem occurred when the tensor size of higher_res_feature doesn't match it with lower ones, whose torch.size is now ([1, 128, 48, 64] and ([1, 128, 46, 63] ) separately as you can see in my picture attached below.Would you please tell me how should I do next to make it work?
20200609140620

I also ran into this, except with a different size image. It seems like the Eval script is just broken.

RuntimeError: The size of tensor a (327) must match the size of tensor b (328) at non-singleton dimension 3