edgetpu: AttributeError: 'Delegate' object has no attribute '_library'

Hey @Namburger, I’ve got a new issue here I’m hoping you can help me out with…

My setup:

Using a Coral M.2 Accelerator A+E key in a device running Ubuntu 16.04 The model file is a MobileNet v2 SSD object detection model compiled for edgetpu, and I have successfully run this model file without issue on other similar devices. Running dpkg -l | grep libedgetpu yields: ii libedgetpu1-std:amd64 14.1 amd64 Support library for Edge TPU I’m pretty sure that the only change since my code was working is that it used to be running 14.0 and has just now updated to 14.1.

Running:

import tflite_runtime.interpreter as tflite

model = tflite.Interpreter(
    "/src/object_detection/model/model_edgetpu.tflite", 
    experimental_delegates=[tflite.load_delegate('libedgetpu.so.1')]
)
model.allocate_tensors()

The model.allocate_tensors() call results in the following RuntimeError:

RuntimeError: Encountered unresolved custom op: edgetpu-custom-op.Node number 0 (edgetpu-custom-op) failed to prepare.
Stack (most recent call last):
  File "OID_Launcher.py", line 203, in <module>
    ObjectIdentification(config=config).run()
  File "OID_Launcher.py", line 34, in __init__
    models = self.__load_models(cameras_dict)
  File "OID_Launcher.py", line 75, in __load_models
    logger.critical('Error: Unable to load models. {}'.format(e), exc_info=True, stack_info=True)
Exception ignored in: <bound method Delegate.__del__ of <tflite_runtime.interpreter.Delegate object at 0x7f2a16f79160>>
Traceback (most recent call last):
  File "/home/oid/Envs/object_identification/lib/python3.5/site-packages/tflite_runtime/interpreter.py", line 125, in __del__
    if self._library is not None:
AttributeError: 'Delegate' object has no attribute '_library'
terminate called without an active exception

Do you know what might be causing this new error? Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 35

Most upvoted comments

Hi all, I am facing the same issue windows10. Any work around? Please help me,

Finally did this update and confirmed the new version is running stably. Thanks again, @Namburger !

@Namburger awesome, great to hear! Thanks for all your support getting this working!

@BotScutters Okay we’ve fixed the apt package for now 😃

You can simply uninstall it, update apt package and reinstall it and it should works now:

sudo apt purge libedgetpu1-std
sudo apt update
sudo apt get libedgetpu1-std

Thanks @Namburger, confirmed that downgrading back to v14 works. Please let me know once you’ve got a fix for this.