Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime error while running eveal.py on voc datasets #32

Open
GUESSVPN opened this issue Jun 8, 2020 · 6 comments
Open

runtime error while running eveal.py on voc datasets #32

GUESSVPN opened this issue Jun 8, 2020 · 6 comments

Comments

@GUESSVPN
Copy link

GUESSVPN commented Jun 8, 2020

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.

@Tramac
Copy link
Owner

Tramac commented Jun 8, 2020

Maybe because of the input size.

@GUESSVPN
Copy link
Author

GUESSVPN commented Jun 8, 2020

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

@Tramac
Copy link
Owner

Tramac commented Jun 8, 2020

What is the current input size?

@GUESSVPN
Copy link
Author

GUESSVPN commented Jun 8, 2020

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]

@GUESSVPN
Copy link
Author

GUESSVPN commented Jun 9, 2020

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

@Inquisitive-ME
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants