facebookresearch / audio2photoreal

Code and dataset for photorealistic Codec Avatars driven from audio
Other
2.7k stars 254 forks source link

ERROR: Exception in ASGI application #6

Closed MustaphaU closed 9 months ago

MustaphaU commented 9 months ago

First, I would like to thank you for the incredible project and for making it public.

My issue is after recording the audio and hitting the submit button, I run into the Exception in ASGI application error. Below is the full log:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\fastapi\applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\applications.py", line 116, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
    raise exc
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\middleware\cors.py", line 83, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 55, in wrapped_app
    raise exc
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 44, in wrapped_app
    await app(scope, receive, sender)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\routing.py", line 746, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\routing.py", line 75, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 55, in wrapped_app
    raise exc
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 44, in wrapped_app
    await app(scope, receive, sender)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\routing.py", line 73, in app
    await response(scope, receive, send)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\responses.py", line 340, in __call__
    await send(
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 41, in sender
    await send(message)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\_exception_handler.py", line 41, in sender
    await send(message)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\starlette\middleware\errors.py", line 161, in _send
    await send(message)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 512, in send
    output = self.conn.send(event=h11.EndOfMessage())
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\h11\_connection.py", line 512, in send
    data_list = self.send_with_data_passthrough(event)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\h11\_connection.py", line 545, in send_with_data_passthrough
    writer(event, data_list.append)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\h11\_writers.py", line 67, in __call__
    self.send_eom(event.headers, write)
  File "C:\Users\musta\anaconda3\envs\a2p_env\lib\site-packages\h11\_writers.py", line 96, in send_eom
    raise LocalProtocolError("Too little data for declared Content-Length")
h11._util.LocalProtocolError: Too little data for declared Content-Length

Device is Windows 11

alexanderrichard commented 9 months ago

Hi! This error is thrown from third party libraries. A quick google search revealed that others had similar issues in other repos with gradio demos. This here seems a solution that worked for many: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6883

MustaphaU commented 9 months ago

Hi! This error is thrown from third party libraries. A quick google search revealed that others had similar issues in other repos with gradio demos. This here seems a solution that worked for many: AUTOMATIC1111/stable-diffusion-webui#6883

Thank you. The issue resolved after upgrading my gradio and restarting the server but there is a new one. Any thoughts on this, please?

  File "C:\Users\musta\audio2photoreal\model\diffusion.py", line 388, in forward
    cond_tokens = torch.where(
RuntimeError: The size of tensor a (11598) must match the size of tensor b (1998) at non-singleton dimension 1
evonneng commented 9 months ago

Hi @MustaphaU I believe this thread should be related to your question #31

MustaphaU commented 9 months ago

Thanks @evonneng I tried with a 12 secs (i.e.<20 secs) audio and it worked!!