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

The future belongs to a different loop than the one specified as the loop argument #2901

Open
zxncbzxcnm opened this issue Aug 1, 2024 · 0 comments

Comments

@zxncbzxcnm
Copy link

ERROR: Exception in ASGI application

Traceback (most recent call last):

File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 404, in run_asgi

result = await app(  # type: ignore[func-returns-value]

File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 78, in call

return await [self.app](https://unsafelink.com/http://self.app)(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 273, in call

await super().__call__(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 122, in call

await self.middleware_stack(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 184, in call

raise exc

File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 162, in call

await [self.app](https://unsafelink.com/http://self.app)(scope, receive, _send)

File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 84, in call

await [self.app](https://unsafelink.com/http://self.app)(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 79, in call

raise exc

File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 68, in call

await [self.app](https://unsafelink.com/http://self.app)(scope, receive, sender)

File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in call

raise e

File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in call

await [self.app](https://unsafelink.com/http://self.app)(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 718, in call

await route.handle(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 276, in handle

await [self.app](https://unsafelink.com/http://self.app)(scope, receive, send)

File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 66, in app

response = await func(request)

File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 227, in app

solved_result = await solve_dependencies(

File "/usr/local/lib/python3.10/dist-packages/fastapi/dependencies/utils.py", line 545, in solve_dependencies

solved = await run_in_threadpool(call, **sub_values)

File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 41, in run_in_threadpool

return await [anyio.to](https://unsafelink.com/http://anyio.to)_[thread.run](https://unsafelink.com/http://thread.run)_sync(func, *args)

File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync

return await get_asynclib().run_sync_in_worker_thread(

AttributeError: partially initialized module 'anyio._backends._asyncio' has no attribute 'run_sync_in_worker_thread' (most likely due to a circular import)

After this error appears, it runs, but when you try to create an AI image,

✔ Connected
Startup time: 304.2s (launcher: 1.0s, import torch: 12.4s, import gradio: 1.3s, setup paths: 39.3s, import ldm: 1.3s, initialize shared: 6.4s, other imports: 48.6s, setup codeformer: 0.8s, setup gfpgan: 0.4s, list SD models: 8.4s, list localizations: 0.3s, load scripts: 44.1s, load upscalers: 1.4s, reload hypernetworks: 0.6s, initialize extra networks: 25.1s, scripts before_ui_callback: 3.5s, create ui: 35.1s, gradio launch: 68.6s, add APIs: 5.5s).
Creating model from config: /content/gdrive/MyDrive/sd/stablediffusion/generative-models/configs/inference/sd_xl_base.yaml
The future belongs to a different loop than the one specified as the loop argument
The future belongs to a different loop than the one specified as the loop argument
The future belongs to a different loop than the one specified as the loop argument
The future belongs to a different loop than the one specified as the loop argument
The future belongs to a different loop than the one specified as the loop argument
The future belongs to a different loop than the one specified as the loop argument
Loading VAE weights specified in settings: /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/VAE/sdxl_vae.safetensors
Applying attention optimization: xformers... done.
Model loaded in 267.1s (load weights from disk: 205.8s, load config: 0.7s, create model: 8.3s, apply weights to model: 34.5s, load VAE: 12.4s, hijack: 1.0s, load textual inversion embeddings: 3.5s, calculate empty prompt: 0.8s).

**It doesn't work because this error appears.
I've already tried turning it off and restarting it several times, reinstalling the SD folder, and reinstalling Python, but the same symptoms persist.
I also uploaded the latest Colab notes.

As a temporary solution, if you delete the libtcmalloc folder after an error occurs and then run it again, it works normally, but the problem occurs every time you restart.
Run -> Error occurred -> Delete automatically created libtcmalloc folder -> Restart
You have to go through this process every time.
What on earth is the problem?**

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

1 participant