moabitcoin / holy-edge

Holistically-Nested Edge Detection

Home Page:https://arxiv.org/pdf/1504.06375.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dimension Mismatch

moinnadeem opened this issue · comments

Console Error Log

2018-05-06 17:38:44.599331: W tensorflow/core/framework/op_kernel.cc:1152] Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [1,400,600,1] vs. shape[4] = [1,400,608,1]
[[Node: concat = ConcatV2[N=5, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](side_1/conv2d_transpose, side_2/conv2d_transpose, side_3/conv2d_transpose, side_4/conv2d_transpose, side_5/conv2d_transpose, concat/axis)]]
Traceback (most recent call last):
File "run-hed.py", line 64, in
main(args)
File "run-hed.py", line 44, in main
tester.run(session)
File "/home/mnadeem/research/holy-edge/hed/test.py", line 68, in run
edgemap = session.run(self.model.predictions, feed_dict={self.model.images: [im]})
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: ConcatOp : Dimensions of inputs should match: shape[0] = [1,400,600,1] vs. shape[4] = [1,400,608,1]
[[Node: concat = ConcatV2[N=5, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](side_1/conv2d_transpose, side_2/conv2d_transpose, side_3/conv2d_transpose, side_4/conv2d_transpose, side_5/conv2d_transpose, concat/axis)]]

Caused by op u'concat', defined at:
File "run-hed.py", line 64, in
main(args)
File "run-hed.py", line 43, in main
tester.setup(session)
File "/home/mnadeem/research/holy-edge/hed/test.py", line 37, in setup
self.model = Vgg16(self.cfgs, run='testing')
File "/home/mnadeem/research/holy-edge/hed/models/vgg16.py", line 30, in init
self.define_model()
File "/home/mnadeem/research/holy-edge/hed/models/vgg16.py", line 81, in define_model
self.fuse = self.conv_layer(tf.concat(self.side_outputs, axis=3),
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1034, in concat
name=name)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 519, in _concat_v2
name=name)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/mnadeem/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [1,400,600,1] vs. shape[4] = [1,400,608,1]
[[Node: concat = ConcatV2[N=5, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](side_1/conv2d_transpose, side_2/conv2d_transpose, side_3/conv2d_transpose, side_4/conv2d_transpose, side_5/conv2d_transpose, concat/axis)]]

Config:

training:
dir: HED-BSDS
list: HED-BSDS/train_pair.lst
#
image_width: 480
image_height: 480
n_channels: 3

testing data

testing:
dir: mrl_database
list: mrl_database/files.lst
#
image_width: 600
image_height: 400
n_channels: 3

I just want to use the pre-trained weights.

commented

I have similar question. Have you solved it?

@moinnadeem @yfnn @sandhawalia
Has anybody solved this problem?