ValueError: Tensor data is null. Run allocate_tensors() first

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
torkilt
Posts: 38
Joined: Thu Jul 06, 2017 10:56 am

ValueError: Tensor data is null. Run allocate_tensors() first

Post by torkilt »

Mlapi works fine otherwise but I can't get the TPU to work on CentOS Stream 9:

Code: Select all

Jun 29 2023 11:40:30.367815 [DBG 2] Got pyzm_uid0_tpu_lock portalock
Jun 29 2023 11:40:30.367875 [DBG 1] |---------- TPU (input image: 800w*600h) ----------|
Jun 29 2023 11:40:30.368200 [DBG 2] Released portalock pyzm_uid0_tpu_lock
Jun 29 2023 11:40:30.368254 [ERR] Error running model: Tensor data is null. Run allocate_tensors() first
Jun 29 2023 11:40:30.368564 [DBG 2] Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyzm/ml/detect_sequence.py", line 710, in detect_stream
    _b,_l,_c,_m = m.detect(image=frame)
  File "/usr/local/lib/python3.9/site-packages/pyzm/ml/object.py", line 71, in detect
    b,l,c,_model_names = self.model.detect(image)
  File "/usr/local/lib/python3.9/site-packages/pyzm/ml/coral_edgetpu.py", line 167, in detect
    _, scale = common.set_resized_input(
  File "/usr/local/lib/python3.9/site-packages/pycoral/adapters/common.py", line 95, in set_resized_input
    tensor = input_tensor(interpreter)
  File "/usr/local/lib/python3.9/site-packages/pycoral/adapters/common.py", line 65, in input_tensor
    return interpreter.tensor(tensor_index)()[0]
  File "/usr/local/lib/python3.9/site-packages/tflite_runtime/interpreter.py", line 818, in <lambda>
    return lambda: self._interpreter.tensor(self._interpreter, tensor_index)
ValueError: Tensor data is null. Run allocate_tensors() first
Anyone seen this error before?

Mvh.

Torkil
Post Reply