we are trying to use the hailo libraries in our custom script file using pre-trained hef model but we are facing error in function reorganize_split_out_numpy and reorganize_split_output in file yolo.py ,the error indicates the dimension difference .
"device: [‘0000:3a:00.0’]
hef config: {‘yolox_s_leaky’: <hailo_platform.pyhailort._pyhailort.ConfigureParams object at 0x7f1838f42870>}
Network group: <hailo_platform.pyhailort.pyhailort.ConfiguredNetwork object at 0x7f1838491340>
network group params: <hailo_platform.pyhailort._pyhailort.ActivateNetworkGroupParams object at 0x7f1838fbbc30>
input vstream info: VStreamInfo(“yolox_s_leaky/input_layer1”)
output vstream info: VStreamInfo(“yolox_s_leaky/conv55”)
input vstream params: {‘yolox_s_leaky/input_layer1’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbbe70>}
input vstream params: {‘yolox_s_leaky/conv54’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbbbb0>, ‘yolox_s_leaky/conv55’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbb370>, ‘yolox_s_leaky/conv56’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbb0b0>, ‘yolox_s_leaky/conv68’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbb5f0>, ‘yolox_s_leaky/conv69’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbb6b0>, ‘yolox_s_leaky/conv70’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbffb0>, ‘yolox_s_leaky/conv81’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbfd30>, ‘yolox_s_leaky/conv82’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbf070>, ‘yolox_s_leaky/conv83’: <hailo_platform.pyhailort._pyhailort.VStreamParams object at 0x7f1838fbfc70>}
model data input shape info: (640, 640, 3)
reading :/home/hailo/Umraz/exp-1/data/detection12.mp4
frame number: 1
layer shapes :############ {(1, 20, 20, 80): ‘yolox_s_leaky/conv81’, (1, 40, 40, 4): ‘yolox_s_leaky/conv69’, (1, 80, 80, 4): ‘yolox_s_leaky/conv55’, (1, 20, 20, 4): ‘yolox_s_leaky/conv82’, (1, 40, 40, 1): ‘yolox_s_leaky/conv70’, (1, 40, 40, 80): ‘yolox_s_leaky/conv68’, (1, 80, 80, 80): ‘yolox_s_leaky/conv54’, (1, 80, 80, 1): ‘yolox_s_leaky/conv56’, (1, 20, 20, 1): ‘yolox_s_leaky/conv83’}
2024-06-19 16:43:26.211271: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-06-19 16:43:27.900746: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
anchors : {‘strides’: [32, 16, 8], ‘sizes’: [[1, 1], [1, 1], [1, 1]]}
post proc: <hailo_model_zoo.core.postprocessing.detection.yolo.YoloPostProc object at 0x7f18395eb5e0>
Transposed endnodes shapes:
Shape of endnode 0: (1, 4, 80, 80)
Shape of endnode 1: (1, 1, 80, 80)
Shape of endnode 2: (1, 80, 80, 80)
Shape of endnode 3: (1, 4, 40, 40)
Shape of endnode 4: (1, 1, 40, 40)
Shape of endnode 5: (1, 80, 40, 40)
Shape of endnode 6: (1, 4, 20, 20)
Shape of endnode 7: (1, 1, 20, 20)
Shape of endnode 8: (1, 80, 20, 20)
Traceback (most recent call last):
File “test.py”, line 234, in
hailo_preds = yolox_post_proc.yolo_postprocessing(endnodes_transposed)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/postprocessing/detection/yolo.py”, line 339, in yolo_postprocessing
endnodes = self.reorganize_split_output(endnodes)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/postprocessing/detection/yolo.py”, line 535, in reorganize_split_output
branch_endnodes = tf.numpy_function(self.reorganize_split_output_numpy,
File “/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py”, line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/postprocessing/detection/yolo.py”, line 577, in reorganize_split_output_numpy
partial_concat = np.concatenate([center_slice, scale_slice, obj_slice, prob_slice], axis=-1)
File “<array_function internals>”, line 180, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 4 and the array at index 2 has size 1".
please resolve it.