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

pretrained model with a test image: Invalid Argument and Incompatible Shapes #44

Open
zBabar opened this issue Apr 26, 2018 · 1 comment

Comments

@zBabar
Copy link

zBabar commented Apr 26, 2018

I am trying to run pertained model with a test image. after settling lot of things still I got certain error like

InvalidArgumentError (see above for traceback): Incompatible shapes: [1,28,28,21] vs. [1,16,16,21]

[[Node: fcn_8s/add = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fcn_8s/pool4_fc/BiasAdd, fcn_8s/conv2d_transpose)]]

Do I need to change the shape of the image first? But for each test image it says different dimensions vs different dimensions

Moreover whats the purpose of num_classes in pertained model? and what should it be for a test image?

@Senyao-Han
Copy link

I believe it's a padding problem.
just go to slim/nets/vgg.py, change this line:
net = slim.conv2d(net, 4096, [7, 7], padding='VALID', scope='fc6')
to padding='SAME'. It will be okay.
The thing is, my result is not good. I've got low contrast images.

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