snowzach / doods2

API for detecting objects in images and video streams using Tensorflow
MIT License
221 stars 28 forks source link

EdgeTPU models not working #105

Open bbo76 opened 2 months ago

bbo76 commented 2 months ago

I download differents edgetpu model from the coral website and nothing work, when I click on detect I have this error:

2024-04-19 20:59:34,436 - uvicorn.error - ERROR - Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi result = await app(self.scope, self.receive, self.send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/fastapi/applications.py", line 208, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.11/dist-packages/starlette/applications.py", line 112, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 181, in call raise exc File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 159, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/dist-packages/prometheus_fastapi_instrumentator/middleware.py", line 169, in call raise exc File "/usr/local/lib/python3.11/dist-packages/prometheus_fastapi_instrumentator/middleware.py", line 167, in call await self.app(scope, receive, send_wrapper) File "/usr/local/lib/python3.11/dist-packages/starlette/exceptions.py", line 82, in call raise exc File "/usr/local/lib/python3.11/dist-packages/starlette/exceptions.py", line 71, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 656, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 259, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 61, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 226, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 159, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/doods/api.py", line 113, in image detect_response = self.doods.detect(detect_request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/doods/doods.py", line 139, in detect ret = detector.detect(image) ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/doods/detectors/tflite.py", line 92, in detect interpreter.invoke() File "/usr/local/lib/python3.11/dist-packages/tflite_runtime/interpreter.py", line 941, in invoke self._interpreter.Invoke() RuntimeError: Encountered an unresolved custom op. Did you miss a custom op or delegate?Node number 4 (EdgeTpuDelegateForCustomOp) failed to invoke.

config looks like this:

It runs with docker image :latest

snowzach commented 2 months ago

Try it now..

yzjJosh commented 1 month ago

I got the same error. Downgrading to docker image version 1.1.10 seems to resolve the problem.

snowzach commented 2 weeks ago

Yeah, I need to try again to build an image with a later tensorflow and still support EdgeTPU. They are so difficult to build a compatible release. All the software is super finicky.