UX-Decoder/Semantic-SAM

demo运行问题

Wilsonwangs opened this issue · 6 comments

/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1659484810403/work/aten/src/ATen/native/TensorShape.cpp:2894.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
$UNUSED$ criterion.empty_weight, Ckpt Shape: torch.Size([2])
/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/gradio/components/image.py:390: UserWarning: The style method is deprecated. Please set these arguments in the constructor instead.
warnings.warn(
/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/gradio/components/gallery.py:205: UserWarning: The style method is deprecated. Please set these arguments in the constructor instead.
warnings.warn(
/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/gradio/components/gallery.py:209: UserWarning: The 'grid' parameter will be deprecated. Please use 'grid_cols' in the constructor instead.
warnings.warn(
sys:1: UserWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 20.0}
sys:1: UserWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 1.0}
sys:1: UserWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 2.0}
sys:1: UserWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 6.0}
sys:1: UserWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 9.0}
Running on local URL: http://127.0.0.1:6082
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/fastapi/applications.py", line 289, in call
await super().call(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/middleware/cors.py", line 83, in call
await self.app(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/fastapi/routing.py", line 273, in app
raw_response = await run_endpoint_function(
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/fastapi/routing.py", line 192, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/gradio/routes.py", line 289, in api_info
return gradio.blocks.get_api_info(config, serialize) # type: ignore
File "/home/user2/miniconda3/envs/semanticsam/lib/python3.8/site-packages/gradio/blocks.py", line 518, in get_api_info
serializer = serializing.COMPONENT_MAPPINGtype
KeyError: 'dataset'
出现了这个问题,会弹出Gradio,但是上传图片点击run之后,没有反应

This seems like a problem related to your Python environment. I am not sure about the reason yet. Did you install the environment as our instructions?

python3.9, torch==1.13.1, torchvision==0.14.1和cu11.3的环境遇到了同样的问题

@Zhangwt95 @Wilsonwangs pip install gradio_client==0.2.7 fixes the bug for me.

@Zhangwt95 @Wilsonwangs pip install gradio_client==0.2.7 fixes the bug for me.

Thank you very much! By using your method, this bug has been resolved.

@Zhangwt95 @Wilsonwangs pip install gradio_client==0.2.7 fixes the bug for me.

Thank you very much! By using your method, this bug has been resolved.

May I ask where to download the data set of this code reproduction? Can you add a contact information to ask a few questions?

你好、我在运行demo的时候遇到了同样的问题,通过pip install gradio_client==0.2.7,解决了,但我选择图片,点击然后run,一直在转圈
be3a0a10e0b73c131d738bed18cd9b1