xiaochus / YOLOv3

Keras implementation of yolo v3 object detection.
MIT License
603 stars 264 forks source link

Value Error #20

Open Tawannaer opened 5 years ago

Tawannaer commented 5 years ago

I found an error in this code. I am looking forward to the author's reply thanks File "demo.py", line 152, in image = detect_image(image, yolo, all_classes) File "demo.py", line 90, in detect_image boxes, classes, scores = yolo.predict(pimage, image.shape) File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 209, in predict boxes, classes, scores = self._yolo_out(outs, shape) File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 158, in _yolo_out b, c, s = self._process_feats(out, anchors, mask) File "C:\Users\Administrator\Desktop\YOLOv3-master\model\yolo_model.py", line 54, in _process_feats box_wh = box_wh * anchors_tensor ValueError: operands could not be broadcast together with shapes (13,13,2) (1,1,3,2) qq 20181214105101

Tawannaer commented 5 years ago

@xiaochus

xiaochus commented 5 years ago

I did not have this problem in the local test, whether you are using the old code?

Tawannaer commented 5 years ago

Thank you for your reply, I have updated the code. But there is still this problem. If you have a better discovery, please contact me. thank you very much

cansik commented 5 years ago

Same issue here when using plaidml as backend (can not test it with tensorflow on mac). @aichijing How did you fix this?

python3 demo_plaid.py
Using plaidml.keras.backend backend.
INFO:plaidml:Opening device "opencl_amd_amd_radeon_pro_460_compute_engine.0"
/usr/local/lib/python3.7/site-packages/keras/engine/saving.py:269: UserWarning: No training configuration found in save file: the model was *not* compiled. Compile it manually.
  warnings.warn('No training configuration found in save file: '
dog.jpg
INFO:plaidml:Analyzing Ops: 164 of 1106 operations complete
INFO:plaidml:Analyzing Ops: 346 of 1106 operations complete
INFO:plaidml:Analyzing Ops: 545 of 1106 operations complete
INFO:plaidml:Analyzing Ops: 836 of 1106 operations complete
INFO:plaidml:Analyzing Ops: 1056 of 1106 operations complete
Traceback (most recent call last):
  File "demo_plaid.py", line 155, in <module>
    image = detect_image(image, yolo, all_classes)
  File "demo_plaid.py", line 93, in detect_image
    boxes, classes, scores = yolo.predict(pimage, image.shape)
  File "YOLOv3/model/yolo_model.py", line 208, in predict
    boxes, classes, scores = self._yolo_out(outs, shape)
  File "YOLOv3/model/yolo_model.py", line 157, in _yolo_out
    b, c, s = self._process_feats(out, anchors, mask)
  File "YOLOv3/model/yolo_model.py", line 53, in _process_feats
    box_wh = box_wh * anchors_tensor
ValueError: operands could not be broadcast together with shapes (13,13,2) (1,1,3,2)
amichayfeldman commented 5 years ago

what is your input image's shape?

i opened a new issue about mistake i found in the code. look there and maybe it can help you.