nilboy / tensorflow-yolo

tensorflow implementation of 'YOLO : Real-Time Object Detection'(train and test)
773 stars 312 forks source link

how to test my own dataset #29

Open knzano1 opened 6 years ago

knzano1 commented 6 years ago

Hi I'm new to ML and tensorflow. I'm trying to use tensorflow-yolo to train model for hand recognition. No. of classes is 1 which is hand

when I run train.py it returns Padding -ve error.

Caused by op u'while_2/Pad', defined at: File "tools/train.py", line 22, in solver = eval(solver_params['name'])(dataset, net, common_params, solver_params) File "./yolo/solver/yolo_solver.py", line 32, in init self.construct_graph() File "./yolo/solver/yolo_solver.py", line 62, in construct_graph self.total_loss, self.nilboy = self.net.loss(self.predicts, self.labels, self.objects_num) File "./yolo/net/yolo_tiny_net.py", line 297, in loss tuple_results = tf.while_loop(self.cond1, self.body1, [tf.constant(0), object_num, [class_loss, object_loss, noobject_loss, coord_loss], predict, label, nilboy]) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2775, in while_loop result = context.BuildLoop(cond, body, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2604, in BuildLoop pred, body, original_loop_vars, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2554, in _BuildLoop body_result = body(*packed_vars_for_body) File "./yolo/net/yolo_tiny_net.py", line 175, in body1 objects = tf.pad(objects, temp, "CONSTANT") File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1679, in pad return gen_array_ops._pad(tensor, paddings, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 1989, in _pad 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 2630, 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 1204, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Paddings must be non-negative: 4 -1 [[Node: while_2/Pad = Pad[T=DT_FLOAT, Tpaddings=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](while_2/ones, while_2/Reshape_1)]] [[Node: gradients/AddN_132/_185 = _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_49524_gradients/AddN_132", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Do you have any idea cause of this issue? Regards

kongkongqixi commented 6 years ago

tf.pad error,Enter the size of the data, An error occurred while tf.pad filling the boundary, the number of filled boundaries is negative

a258sa258s commented 6 years ago

same problem

maidousi commented 6 years ago

same problem

contactmat85 commented 6 years ago

same problem

Divyagarwalfeb commented 5 years ago

be careful while reading xmin, xmax, ymin, ymax.