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

Support of testing for any size image #34

Open
rose-jinyang opened this issue Sep 2, 2020 · 5 comments
Open

Support of testing for any size image #34

rose-jinyang opened this issue Sep 2, 2020 · 5 comments

Comments

@rose-jinyang
Copy link

Hello
How are you?
Thanks for contributing this project.
It seems that the script demo.py can not process any size of image.
Could u revise the script so that it can process any size of image?
Thanks.

@Tramac
Copy link
Owner

Tramac commented Sep 2, 2020

There is no limit to the image size in the demo.py.

@rose-jinyang
Copy link
Author

rose-jinyang commented Sep 2, 2020

Hi
I used the size 875x583 of image.
Please check this issue.

Traceback (most recent call last):
File "E:/Jin/Internet_Task/Jobs/2020/2020.08.31-U2_Net/Fast-SCNN-pytorch-master/demo.py", line 57, in
demo()
File "E:/Jin/Internet_Task/Jobs/2020/2020.08.31-U2_Net/Fast-SCNN-pytorch-master/demo.py", line 49, in demo
outputs = model(image)
File "C:\Users\admin\Anaconda3\envs\py37_tf2.x\lib\site-packages\torch\nn\modules\module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "E:\Jin\Internet_Task\Jobs\2020\2020.08.31-U2_Net\Fast-SCNN-pytorch-master\models\fast_scnn.py", line 37, in forward
x = self.feature_fusion(higher_res_features, x)
File "C:\Users\admin\Anaconda3\envs\py37_tf2.x\lib\site-packages\torch\nn\modules\module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "E:\Jin\Internet_Task\Jobs\2020\2020.08.31-U2_Net\Fast-SCNN-pytorch-master\models\fast_scnn.py", line 213, in forward
out = higher_res_feature + lower_res_feature
RuntimeError: The size of tensor a (110) must match the size of tensor b (112) at non-singleton dimension 3

Thanks

@rose-jinyang
Copy link
Author

rose-jinyang commented Sep 2, 2020

Hi
I did padding so that the width and height of image can be multiples of 32.
So the issue disappeared but the result is not normal.
This is the padded input image.
1

That is the output image.
Esha-gupta

How can I understand this?
Thanks

@milad-4274
Copy link

same problem. did you find any solution?
thanks

@Linda-L
Copy link

Linda-L commented Dec 13, 2020

There was no such problem during the first training. The same data set for the second training is reported as follows:

Traceback (most recent call last): File "/home/lyl/000_Code/Fast-SCNN/train.py", line 200, in <module> trainer.train() File "/home/lyl/000_Code/Fast-SCNN/train.py", line 127, in train for i, (images, targets) in enumerate(self.train_loader): File "/home/lyl/anaconda3/envs/fastscnn1.0/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in __next__ batch = self.collate_fn([self.dataset[i] for i in indices]) File "/home/lyl/anaconda3/envs/fastscnn1.0/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in <listcomp> batch = self.collate_fn([self.dataset[i] for i in indices]) File "/home/lyl/000_Code/Fast-SCNN/data_loader/cityscapes.py", line 93, in __getitem__ img, mask = self._sync_transform(img, mask) File "/home/lyl/000_Code/Fast-SCNN/data_loader/cityscapes.py", line 141, in _sync_transform img = img.resize((ow, oh), Image.BILINEAR) File "/home/lyl/anaconda3/envs/fastscnn1.0/lib/python3.6/site-packages/PIL/Image.py", line 1923, in resize return self._new(self.im.resize(size, resample, box)) ValueError: height and width must be > 0

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

4 participants