google-coral / edgetpu

Coral issue tracker (and legacy Edge TPU API source)
https://coral.ai
Apache License 2.0
429 stars 125 forks source link

Failed to load delegate from edgetpu.dll #853

Open shinytreecko opened 5 months ago

shinytreecko commented 5 months ago

Description

This is a strange issue. Every time I run my python code to use the Edge TPU, I get the following traceback:

Traceback (most recent call last):
 File "C:\Users\user\.conda\envs\pycoral\lib\site-packages\tflite_runtime\interpreter.py", line 160, in load_delegate
  delegate = Delegate(library, options)
 File "C:\Users\user\.conda\envs\pycoral\lib\site-packages\tflite_runtime\interpreter.py", line 119, in __init__
  raise ValueError(capture.message)
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "C:\Users\user\Desktop\ocr_for_serials\nolag.py", line 11, in <module>
  interpreter = make_interpreter('edgetpu.tflite')
 File "C:\Users\user\.conda\envs\pycoral\lib\site-packages\pycoral\utils\edgetpu.py", line 87, in make_interpreter
  delegates = [load_edgetpu_delegate({'device': device} if device else {})]
 File "C:\Users\user\.conda\envs\pycoral\lib\site-packages\pycoral\utils\edgetpu.py", line 52, in load_edgetpu_delegate
  return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {})
 File "C:\Users\user\.conda\envs\pycoral\lib\site-packages\tflite_runtime\interpreter.py", line 162, in load_delegate
  raise ValueError('Failed to load delegate from {}\n{}'.format(
ValueError: Failed to load delegate from edgetpu.dll

I was trying to uninstall and reinstall the runtime and pycoral when this first happened, but was completely out of luck until I rebooted my machine and manually installed the edgetpu_runtime_20221024/edgetpu_runtime/third_party/usbdkUsbDk_1.0.22_x64.msi file as suggested in another issue. Now my code will launch and the TPU heats up (which must indicate that it's being used). I'm met with the exact same traceback if I close my program and run it again after making zero changes to the code. To solve this temporarily, I'm able to reboot my computer and reinstall the driver the same way as before, but having to constantly restart whenever my program is closed is very inconvenient. How can I fix this issue?

Click to expand! ### Issue Type Support ### Operating System Windows 10 ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language Python 3.9 ### Relevant Log Output _No response_