Borda / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend) a successor of qqwweee/keras-yolo3
MIT License
31 stars 10 forks source link

number of mask dimensions should be specified #33

Open 0110110 opened 4 years ago

0110110 commented 4 years ago
ValueError                                Traceback (most recent call last)
<ipython-input-12-628fd8754cb7> in <module>
     38 input_image_shape = K.placeholder(shape=(2, ))
     39 boxes, scores, classes = yolo_eval(yolo_model.output, anchors, len(class_names), input_image_shape,
---> 40                                     score_threshold=0.3, iou_threshold=0.45)
     41 
     42 print("YOLO model ready!")

~/library/Mod04/01-Yolo/yolo_keras/model.py in yolo_eval(yolo_outputs, anchors, num_classes, image_shape, max_boxes, score_threshold, iou_threshold)
    213     for c in range(num_classes):
    214         # TODO: use keras backend instead of tf.
--> 215         class_boxes = tf.boolean_mask(boxes, mask[:, c])
    216         class_box_scores = tf.boolean_mask(box_scores[:, c], mask[:, c])
    217         nms_index = tf.image.non_max_suppression(

~/anaconda3_501/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)

~/anaconda3_501/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py in boolean_mask_v2(tensor, mask, axis, name)
   1423                                    #  [[7, 10],
   1424                                    #   [8, 11],
-> 1425                                    #   [9, 12]]]
   1426   ```
   1427 

~/anaconda3_501/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py in boolean_mask(tensor, mask, name, axis)
   1352     name: A name for the operation (optional).
   1353 
-> 1354   Returns:
   1355     if `num_or_size_splits` is a scalar returns `num_or_size_splits` `Tensor`
   1356     objects; if `num_or_size_splits` is a 1-D Tensor returns

ValueError: Number of mask dimensions must be specified, even if some dimensions are None.  E.g. shape=[None] is ok, but shape=None is not.