Open atomrun39 opened 4 years ago
Me too! How to fix it ? Please
I've got almost the same error :
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
Does anyone found a workaround ?
Me too! How to fix it ? Please
I reinstalled the repo and recreate the conda environement and it fixed the error.
I followed this tutorial and it succeeded. https://colab.research.google.com/drive/1OKzbccsdA40sJ67gqmNyblWuEMCfP5zx?usp=sharing#scrollTo=dvN2-COJ9w4k
if you're running tiny model, set the flag --tiny true
python detect.py --weights ./checkpoints/yolov4-224-fp16.tflite --size 224 --model yolov4 --image ./data/49.jpg --framework tflite --tiny true
I've got almost the same error :
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
Does anyone found a workaround ?
I meet the same problem. How do you solve it?
My command:
python detect.py --weights ./checkpoints/yolov4-416-tiny-tf.tflite --size 416 --model yolov4 --image ./data/toast.jpg --framework tflite --tiny true
And my error:
[{'name': 'serving_default_input_1:0', 'index': 0, 'shape': array([ 1, 416, 416, 3]), 'shape_signature': array([ -1, 416, 416, 3]), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}] [{'name': 'StatefulPartitionedCall:1', 'index': 211, 'shape': array([ 1, 2535, 2]), 'shape_signature': array([ 1, -1, 2]), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}, {'name': 'StatefulPartitionedCall:0', 'index': 232, 'shape': array([ 1, 2535, 4]), 'shape_signature': array([ 1, -1, 4]), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}] Traceback (most recent call last): File "detect.py", line 90, in <module> app.run(main) File "C:\Users\s1074\AppData\Roaming\Python\Python38\site-packages\absl\app.py", line 303, in run _run_main(main, args) File "C:\Users\s1074\AppData\Roaming\Python\Python38\site-packages\absl\app.py", line 251, in _run_main sys.exit(main(argv)) File "detect.py", line 61, in main boxes, pred_conf = filter_boxes(pred[0], pred[1], score_threshold=0.25, input_shape=tf.constant([input_size, input_size])) File "D:\yolov4\training\tensorflow-yolov4-tflite-master\core\yolov4.py", line 301, in filter_boxes box_xy, box_wh = tf.split(class_boxes, (2, 2), axis=-1) File "C:\Users\s1074\anaconda3\lib\site-packages\tensorflow\python\util\dispatch.py", line 206, in wrapper return target(*args, **kwargs) File "C:\Users\s1074\anaconda3\lib\site-packages\tensorflow\python\ops\array_ops.py", line 2145, in split return gen_array_ops.split_v( File "C:\Users\s1074\anaconda3\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 10094, in split_v _ops.raise_from_not_ok_status(e, name) File "C:\Users\s1074\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 6897, 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
@tomkisiela @atomrun39 @kaunghtetsan275 @w840401 @drahmad89 Hi, everyone I also meet the problem Did anyone solve the problem? please give me some adivce, tks
Got the same issue, I removed flag --tiny true
and it worked...
python detect.py --weights ./tflite_yolov3/int8.tflite --size 416 --model yolov3 --image ./images/test.jpg --framework tflite
Still not working for me. Same issue "ValueError: Shapes (1, 13, 13) and (1, 26, 26) are incompatible"
Still not working for me. Same issue "ValueError: Shapes (1, 13, 13) and (1, 26, 26) are incompatible"
Have you solved it? I have encountered the same problem. Looking forward to your reply, thanks!
Still not working for me. Same issue "ValueError: Shapes (1, 13, 13) and (1, 26, 26) are incompatible"
Have you solved it? I have encountered the same problem. Looking forward to your reply, thanks!
Refer this https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/413
Hi guys. I encountered the same issue in the evaluate.py script with Yolov4. It seems the order of the outputs, pred[0]
and pred[1]
is random. This leads to a problem with the filter_boxes
function if you are unlucky, 50:50 chance ;). For some people using tiny if normal does not work and vice versa does works (you will see why in the code snippet below). To fix it, you need to change these lines in the detect.py
or evaluate.py
file whichever one you are trying to run.
if FLAGS.model == 'yolov4' and FLAGS.tiny == True:
boxes, pred_conf = filter_boxes(pred[1], pred[0], score_threshold=0.25)
else:
boxes, pred_conf = filter_boxes(pred[0], pred[1], score_threshold=0.25)
So if you face this error and need the tiny model, swap pred[1]
and pred[0]
inside the if-statement. If you face this error and need the normal model swap pred[0]
and pred[1]
inside the else-statement.
First I use darknet to train the yolov4-tiny model, it has two detection classes, and the input image size is 224. The trained weight is first converted to tensorflow, and then converted to tflite. But shape incompatible error appears when running the tflite model, please see below for specific errors.
using:python detect.py --weights ./checkpoints/yolov4-224-fp16.tflite --size 224 --model yolov4 --image ./data/49.jpg --framework tflite