Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doods2 still doesn't work after update (See latest #52) #53

Closed
Idefix0496 opened this issue Sep 12, 2022 · 6 comments
Closed

Doods2 still doesn't work after update (See latest #52) #53

Idefix0496 opened this issue Sep 12, 2022 · 6 comments

Comments

@Idefix0496
Copy link

Idefix0496 commented Sep 12, 2022

Hey I've still got the same Problem. Using a Model which was trained on a recent yolov5 Docker Image I'm getting the following Error Messages:

2022-09-10 17:02:25,639 - 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 159, in call
await self.app(scope, receive, _send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 57, in call
task_group.cancel_scope.cancel()
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 572, in aexit
raise ExceptionGroup(exceptions)
anyio._backends.asyncio.ExceptionGroup: 2 exceptions were raised in the task group:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 55, in call
response = await self.dispatch_func(request, call_next)
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 172, in dispatch_middleware
raise e from None
File "/usr/local/lib/python3.8/dist-packages/prometheus_fastapi_instrumentator/instrumentation.py", line 169, in dispatch_middleware
response = await call_next(request)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 37, in call_next
raise RuntimeError("No response returned.")
RuntimeError: No response returned.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
await self.app(scope, request.receive, send_stream.send)
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 234, in app
response_data = await serialize_response(
File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 137, in serialize_response
raise ValidationError(errors, field.type
)
pydantic.error_wrappers.ValidationError: 1 validation error for DetectorsResponse
response -> detectors -> 0 -> labels
value is not a valid list (type=type_error.list)

I've already raised an Issue on the Yolov5 github Page ultralytics/yolov5#9360
but it seems that there is still an issue on the doods side. In the github issue we discussed a recent change in the class names.
So maybe that's the Problem ?

@Idefix0496
Copy link
Author

Is there really nobody else with the same issue? At that point the whole thing is pretty unusable.

@Idefix0496 Idefix0496 changed the title Doods2 still doesn't work after update /latest #52 Doods2 still doesn't work after update (See latest #52) Sep 27, 2022
@ChienTingLu
Copy link

ChienTingLu commented Sep 29, 2022

I am encountering the same problem.
But I just set this up today, so I'm not sure if I did something wrong.

Here's my log.

2022-09-29 14:28:15,156 - 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/starlette/middleware/base.py", line 57, in __call__
    task_group.cancel_scope.cancel()
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 574, in __aexit__
    raise exceptions[0]
  File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/base.py", line 30, in coro
    await self.app(scope, request.receive, send_stream.send)
  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 64, in app
    await response(scope, receive, send)
  File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 227, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 574, in __aexit__
    raise exceptions[0]
  File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 223, in wrap
    await func()
  File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 212, in stream_response
    async for chunk in self.body_iterator:
  File "/opt/doods/streamer.py", line 36, in mjpeg_streamer
    for detect_response in gen:
  File "/opt/doods/streamer.py", line 14, in start_stream
    vcap = FreshestFrame(vcap)
  File "/opt/doods/fresh_frame.py", line 12, in __init__
    assert self.capture.isOpened()
AssertionError
2022-09-29 14:28:16,559 - uvicorn.access - INFO - 192.168.0.188:12358 - "GET /detectors HTTP/1.1" 200
2022-09-29 14:28:19,054 - uvicorn.access - INFO - 192.168.0.188:12358 - "GET /detectors HTTP/1.1" 200
2022-09-29 14:32:27,977 - uvicorn.access - INFO - 192.168.0.200:46324 - "GET /detectors HTTP/1.1" 200
2022-09-29 14:32:28,003 - uvicorn.access - INFO - 192.168.0.200:46336 - "GET /detectors HTTP/1.1" 200
2022-09-29 14:33:51,735 - doods.doods - INFO - DetectResponse(id='', image=None, detections=[Detection(region_id=None, top=0.29794785380363464, left=0.2571028470993042, bottom=1.0045909881591797, right=0.5932886004447937, label='person', confidence=64.453125, image=None)], error=None, duration=138.5262319818139)
2022-09-29 14:33:51,739 - uvicorn.access - INFO - 192.168.0.200:46110 - "POST /detect HTTP/1.1" 200
2022-09-29 14:34:06,704 - doods.doods - INFO - DetectResponse(id='', image=None, detections=[Detection(region_id=None, top=0.3233772814273834, left=0.2604176998138428, bottom=1.0189393758773804, right=0.5966033935546875, label='person', confidence=64.453125, image=None)], error=None, duration=136.82500703725964)
2022-09-29 14:34:06,707 - uvicorn.access - INFO - 192.168.0.200:52358 - "POST /detect HTTP/1.1" 200

@snowzach
Copy link
Owner

@Idefix0496 your issue is that the labels on your model do not appear to be a list nor a dict like DOODS expects. The only real way for me to fix this is to get a copy of your model and try to figure out what type it is...

@ChienTingLu your installation actually appears to be working fine... I see that it completes a couple detections in the log there and dectects a person. It might be some issue in reading the feed from your camera... but otherwise it looks okay.

@Idefix0496
Copy link
Author

Hey thank's for your answer. I've just tried it again with a freshly trained Coco128 Model (newest Docker Container from yolov5).
The same fault occured again. This is the training command I used:

python -m torch.distributed.launch --nproc_per_node 2 train.py --batch-size 12 --workers 10 --epochs 5 --img 640 --data coco128.yaml --weights yolov5s.pt

And here is the trained Model with the imminent Fault:
best.zip

I would really appreciate it if you could take a look.

@snowzach
Copy link
Owner

snowzach commented Oct 3, 2022

Okay, I think I figured it out. The Yolo support library was out of date. Try pulling the latest image and see if that works.

@Idefix0496
Copy link
Author

Hey thank's for your effort's. It's working fine now. I've tested it with a new trained Model which wasn't working before.
The Webview is also working again without the Error showing up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants