doods2: Exception in ASGI application
Hi there!
Thanks for this amazing package!
I’ve got it installed on Home Assistant and the default models work - i.e. I can detect a bike etc.
I wanted to add a custom model, but I’m getting an “Exception in ASGI application” when I try to run the image.
To confirm
- The doods webpage loads, and the configuration loads.
- I can see my model loaded with the labels. I can do a “default” image with the same image no problem.
Below is the full log.
Attached is the model.
2023-01-19 16:20:00,227 - doods.doods - INFO - Registered detector type:tflite name:default
2023-01-19 16:20:00,235 - doods.doods - INFO - Registered detector type:tflite name:bins
2023-01-19 16:20:00,498 - uvicorn.error - INFO - Started server process [7]
2023-01-19 16:20:00,498 - uvicorn.error - INFO - Waiting for application startup.
2023-01-19 16:20:00,499 - uvicorn.error - INFO - Application startup complete.
2023-01-19 16:20:00,499 - uvicorn.error - INFO - Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
2023-01-19 16:20:03,034 - uvicorn.access - INFO - 192.168.1.158:65298 - "GET / HTTP/1.1" 304
2023-01-19 16:20:03,082 - uvicorn.access - INFO - 192.1
[bin_model.zip](https://github.com/snowzach/doods2/files/10453903/bin_model.zip)
68.1.158:65298 - "GET /detectors HTTP/1.1" 200
2023-01-19 16:20:09,572 - uvicorn.access - INFO - 192.168.1.158:65299 - "POST /image HTTP/1.1" 500
2023-01-19 16:20:09,573 - uvicorn.error - ERROR - Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.8/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.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 208, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/middleware.py", line 103, in __call__
raise exc
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/middleware.py", line 101, in __call__
await self.app(scope, receive, send_wrapper)
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in __call__
raise exc
File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in __call__
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 226, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.8/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 114, in detect
for i in range(int(count)):
TypeError: only size-1 arrays can be converted to Python scalars
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (6 by maintainers)
Great! Will close this.