YOLOv3 icon indicating copy to clipboard operation
YOLOv3 copied to clipboard

Value Error

Open Tawannaer opened this issue 5 years ago • 5 comments

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 avatar Dec 14 '18 03:12 Tawannaer

@xiaochus

Tawannaer avatar Dec 14 '18 03:12 Tawannaer

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

xiaochus avatar Dec 14 '18 05:12 xiaochus

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

Tawannaer avatar Dec 14 '18 06:12 Tawannaer

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)

cansik avatar Jan 28 '19 23:01 cansik

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.

amichayfeldman avatar Apr 02 '19 08:04 amichayfeldman