Tensorflow version:
tensorflow 2.9.1+nv22.9
Jetpack version:
Errors when run the code as below:
def main():
# Load the TFLite model and allocate tensors.
interpreter = tf.lite.Interpreter(model_path="model.tflite")
interpreter.allocate_tensors()
#return
# Get input and output tensors.
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
# Test the model on random input data.
input_shape = input_details[0]['shape']
input_data = np.array(np.random.random_sample(input_shape), dtype=np.float32)
#interpreter.set_tensor(input_details[0]['index'], input_data)
signatures = interpreter.get_signature_list()
print(signatures)
interpreter.invoke()
return
# The function `get_tensor()` returns a copy of the tensor data.
# Use `tensor()` in order to get a pointer to the tensor.
output_data = interpreter.get_tensor(output_details[0]['index'])
print(output_data)
The error info as below:
Traceback (most recent call last):
File “infer_lite.py”, line 32, in
main()
File “infer_lite.py”, line 23, in main
interpreter.invoke()
File “/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/interpreter.py”, line 915, in invoke
self._interpreter.Invoke()
RuntimeError: tensorflow/lite/kernels/concatenation.cc:158 t->dims->data[d] != t0->dims->data[d] (1 != 2)Node number 304 (CONCATENATION) failed to prepare