DetectionTeamUCAS / Cascade_FPN_Tensorflow

Cascade R-CNN: Delving into High Quality Object Detection.
MIT License
35 stars 10 forks source link

Error “Invalid argument: Incompatible shapes” when I try to run eval.py to evaluate trained weights. #3

Open Yansslc opened 5 years ago

Yansslc commented 5 years ago

I trained this network in my dataset, but when I try to evaluate the trained weights using eval.py, the error occured, can anyone help me? Thanks a lot!!

The details of error: 2019-06-29 07:28:08.835470: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Incompatible shapes: [1012,34] vs. [1016,34] [[Node: add_6 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](mul_4, mul_5)]] 2019-06-29 07:28:08.835525: W tensorflow/core/framework/op_kernel.cc:1158] Invalid argument: Incompatible shapes: [1012,34] vs. [1016,34] [[Node: add_6 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](mul_4, mul_5)]] Traceback (most recent call last): File "eval.py", line 195, in showbox=args.showbox) File "eval.py", line 144, in eval draw_imgs=showbox) File "eval.py", line 71, in eval_with_plac feed_dict={img_plac: raw_img[:, :, ::-1]} # cv is BGR. But need RGB File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 997, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1132, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1152, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1012,34] vs. [1016,34] [[Node: add_6 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](mul_4, mul_5)]] [[Node: postprocess_fastrcnn/unstack_1/_1669 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_9553_postprocess_fastrcnn/unstack_1", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Caused by op u'add_6', defined at: File "eval.py", line 195, in showbox=args.showbox) File "eval.py", line 144, in eval draw_imgs=showbox) File "eval.py", line 43, in eval_with_plac gtboxes_batch=None) File "../libs/networks/build_whole_network.py", line 659, in build_whole_detection_network cls_prob = 0.8 cls_prob_stage3 + 0.1 cls_prob_stage2 + 0.1 * cls_prob_stage1 File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 838, in binary_op_wrapper return func(x, y, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 67, in add result = _op_def_lib.apply_op("Add", x=x, y=y, 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()

InvalidArgumentError (see above for traceback): Incompatible shapes: [1012,34] vs. [1016,34] [[Node: add_6 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](mul_4, mul_5)]] [[Node: postprocess_fastrcnn/unstack_1/_1669 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_9553_postprocess_fastrcnn/unstack_1", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

jjf2014205 commented 3 years ago

Have you solved the problem? I have the same problem.