mystic123 / tensorflow-yolo-v3

Implementation of YOLO v3 object detector in Tensorflow (TF-Slim)
https://medium.com/@pawekapica_31302/implementing-yolo-v3-in-tensorflow-tf-slim-c3c55ff59dbe
Apache License 2.0
893 stars 353 forks source link

misunderstanding about code #31

Closed XhqGlorry11 closed 5 years ago

XhqGlorry11 commented 5 years ago

@mystic123 Hi, thanks for your effort. When I run demo I got the following error, File "demo.py", line 76, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "demo.py", line 57, in main detections = yolo_v3(inputs, len(classes), data_format='NCHW') File "/home/user/Desktop/tensorflow-yolo-v3-master/yolo_v3.py", line 221, in yolo_v3 detect_1 = _detection_layer(inputs, num_classes, _ANCHORS[6:9], img_size, data_format) File "/home/user/Desktop/tensorflow-yolo-v3-master/yolo_v3.py", line 149, in _detection_layer box_sizes = tf.exp(box_sizes) * anchors File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 847, in binary_op_wrapper return func(x, y, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 1091, in _mul_dispatch return gen_math_ops.mul(x, y, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 4759, in mul "Mul", x=x, y=y, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 546, in _apply_op_helper inferred_from[input_arg.type_attr])) TypeError: Input 'y' of 'Mul' Op has type int32 that does not match type float32 of argument 'x'. Any suggestions about what's wrong? Thank you!

XhqGlorry11 commented 5 years ago

no need to bother. The reason is I used python2 instead of python3, and int/int in python2 result in ceil of int, while in python3 the result is float.