tensorflow-yolov4-tflite icon indicating copy to clipboard operation
tensorflow-yolov4-tflite copied to clipboard

ERROR - converting tiny-yolov3 into .tflite int8

Open Arfinul opened this issue 4 years ago • 1 comments

able to detect with-

  • python detect.py --weights ./flc_asset/flc-tiny-yolo3-int8.tflite --size 416 --model yolov3 --image 1.jpg --framework tflite

but i dont think, int8 running properly. As resulted image name is result.png not result-int8.png

with this

  • python detect.py --weights ./flc_asset/flc-tiny-yolo3-int8.tflite --size 416 --model yolov3 --image 1.jpg --framework tflite --tiny

getting error -

File "detect.py", line 90, in app.run(main) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/absl/app.py", line 303, in run _run_main(main, args) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main sys.exit(main(argv)) File "detect.py", line 59, in main boxes, pred_conf = filter_boxes(pred[1], pred[0], score_threshold=0.25, input_shape=tf.constant([input_size, input_size])) File "/home/arfin/Documents/flc-yolov3-tflite/core/yolov4.py", line 301, in filter_boxes box_xy, box_wh = tf.split(class_boxes, (2, 2), axis=-1) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/tensorflow/python/ops/array_ops.py", line 2026, in split value=value, size_splits=size_splits, axis=axis, num_split=num, name=name) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 9945, in split_v _ops.raise_from_not_ok_status(e, name) File "/home/arfin/yolo_to_tf/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 6843, in raise_from_not_ok_status six.raise_from(core._status_to_exception(e.code, message), None) File "", line 3, in raise_from tensorflow.python.framework.errors_impl.InvalidArgumentError: Determined shape must either match input shape along split_dim exactly if fully specified, or be less than the size of the input along split_dim if not fully specified. Got: 4 [Op:SplitV] name: split

Arfinul avatar Jan 13 '21 04:01 Arfinul

I got the same error. Delete converted PB and tflite Again convert yolov3-tiny.weight to PB and PB to int8 tflite

For detection, I used this below command and it worked

python detect.py --weights ./checkpoints/yolov3_416_int8.tflite --size 416 --model yolov3 --image ./data/kite.jpg --framework tflite --tiny

Make sure you added --tiny at last

Ashokcharu avatar Aug 11 '21 07:08 Ashokcharu