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

Test on image of different size #3

Closed
xmba15 opened this issue Nov 5, 2017 · 4 comments
Closed

Test on image of different size #3

xmba15 opened this issue Nov 5, 2017 · 4 comments

Comments

@xmba15
Copy link

xmba15 commented Nov 5, 2017

I resized images of cityscape dataset to 256x512 and I tried inference.py on them with the following command

python inference.py --img-path=./input/test.png

but it kept raising:

tensorflow.python.framework.errors_impl.InvalidArgumentError: input image must be of non-zero size
         [[Node: conv5_3_pool1_interp = ResizeBilinear[T=DT_FLOAT, align_corners=true, _device="/job:localhost/replica:0/task:0/cpu:0"](conv5_3_pool1_conv_bn/Relu, conv5_3_pool1_interp/size)]]

Can you please tell me how to run the inference code with images of different size?

@hellochick
Copy link
Owner

Hey @Bajsk , Im sorry for that I didn't handle different size well. You can pad the image into 713x713 (since the kernel size & stride are designed to this resolution in original work), and it can work well ! I will fix to support different input size soon.

@xmba15
Copy link
Author

xmba15 commented Nov 5, 2017

Thanks for the quick reply. Do you mean the inference.py will work with an image of size 713x713? I have just tried it now but it seems not working?

tensorflow.python.framework.errors_impl.InvalidArgumentError: padded_shape[0]=98 is not divisible by block_shape[0]=4

@hellochick
Copy link
Owner

hellochick commented Nov 6, 2017

@Bajsk , I have fixed this problem, you can update this repo and try your resizied image!
Since padding method is different, so it can work with 720x720. I have fixed the code to support every different size by padding/cropping the input image.

@xmba15
Copy link
Author

xmba15 commented Nov 6, 2017

@hellochick Thanks. Work like a charm now.

@xmba15 xmba15 closed this as completed Nov 6, 2017
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

2 participants