CharlesShang / TFFRCNN

FastER RCNN built on tensorflow
MIT License
874 stars 418 forks source link

Shapes of tensors lhs and rhs doesn't match #88

Closed ChrisDal closed 7 years ago

ChrisDal commented 7 years ago

I trained a new model and when testing it it's okey, but not when the model is used in demo.py.

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [36] rhs shape= [72] [[Node: save/Assign_34 = Assign[T=DT_FLOAT, _class=["loc:@rpn_bbox_pred/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/gpu:0"](rpn_bbox_pred/biases, save/RestoreV2_34/_17)]] [[Node: save/RestoreV2_35/_18 = _Send[T=DT_FLOAT, client_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_102_save/RestoreV2_35", _device="/job:localhost/replica:0/task:0/cpu:0"](save/RestoreV2_35)]]

Traceback Caused by op u'save/Assign_34', defined at: File "./faster_rcnn/demo.py", line 155, in <module> saver = tf.train.Saver() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1139, in __init__ self.build() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1170, in build restore_sequentially=self._restore_sequentially) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 691, in build restore_sequentially, reshape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 419, in _AddRestoreOps assign_ops.append(saveable.restore(tensors, shapes)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 155, in restore self.op.get_shape().is_fully_defined()) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/state_ops.py", line 271, in assign validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 45, in assign use_locking=use_locking, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2506, in create_op original_op=self._default_original_op, op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1269, in __init__ self._traceback = _extract_stack() `