Closed aselva-eb closed 4 years ago
This issue are fixed in newest code
Hi @hunglc007 Thanks for making changes to address the issue. However I'm having a bit of issues running the tflite model:
Heres my flow:
Convert the weights to saved model:
python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4 --framework tflite
Convert to tflite file 16bit quantized:
python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./data/yolov4-416-fp16.tflite --quantize_mode float16
Run the detect with the tflite file as the weights
python detect.py --weights ./data/yolov4-416-fp16.tflite --size 416 --model yolov4 --image ./data/kite.jpg --framework tflite
However I run into this error:
Traceback (most recent call last):
File "detect.py", line 93, in <module>
app.run(main)
File "/Users/abc/miniconda3/envs/yolov4/lib/python3.7/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/Users/abc/miniconda3/envs/yolov4/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "detect.py", line 62, in main
boxes, pred_conf = filter_boxes(pred[1], pred[0], score_threshold=0.25)
File "/Users/abc/object_detection/tensorflow-yolov4-tflite/core/yolov4.py", line 258, in filter_boxes
box_xy, box_wh = tf.split(class_boxes, (2, 2), axis=-1)
File "/Users/abc/miniconda3/envs/yolov4/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py", line 201, in wrapper
return target(*args, **kwargs)
File "/Users/abc/miniconda3/envs/yolov4/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 "/Users/abc/miniconda3/envs/yolov4/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 "/Users/abc/miniconda3/envs/yolov4/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 "<string>", 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
Am I following the instructions incorrectly? Also, can I expect to be able to follow the same instructions for tflite using the yolov4-tiny weights?
Because i set default tiny is True, this issue are fixed.
Thank you
Hello!
I'm trying to run the basic tflite demo but running into the following issue:
Here is the command I use to run the model:
python detect.py --weights ./data/yolov4.tflite --framework tflite --size 416 --image ./data/kite.jpg --tiny yolo-tiny --model yolov4
Anything I'm missing/doing wrong?