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

网页运行显示error,不显示图片 #155

Open
cjf-repo opened this issue Apr 17, 2023 · 7 comments
Open

网页运行显示error,不显示图片 #155

cjf-repo opened this issue Apr 17, 2023 · 7 comments

Comments

@cjf-repo
Copy link

运行的gradio_app.py选择seg的时候(其他的也一样),这里到5s左右就直接显示error,但是代码是没有报错,并且运行到了最后的return [image, mask_pil]这一步,而单独运行grounded_sam_demo.py是可以出来结果的,是我哪里需要修改吗,网页上没有显示出结果
image

@cjf-repo cjf-repo changed the title 网页不显示运行显示error,不显示图片 网页运行显示error,不显示图片 Apr 17, 2023
@Nidacoke
Copy link

#136

@gukehan2000
Copy link

我也是 而且特别吃显存 就这个图10000多MB显存 请问知道怎么改呢

@gukehan2000
Copy link

我也是 而且特别吃显存 就这个图10000多MB显存 请问知道怎么改呢

home/anaconda3/envs/github-2/lib/python3.8/site-packages/transformers/modeling_utils.py:862: FutureWarning: The device argument is deprecated and will be removed in v5 of Transformers.
warnings.warn(
/home/anaconda3/envs/github-2/lib/python3.8/site-packages/torch/utils/checkpoint.py:25: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn("None of the inputs have requires_grad=True. Gradients will be None")
Traceback (most recent call last):
File "/home/naconda3/envs/github-2/lib/python3.8/site-packages/gradio/routes.py", line 401, in run_predict
output = await app.get_blocks().process_api(
File "/home/anaconda3/envs/github-2/lib/python3.8/site-packages/gradio/blocks.py", line 1302, in process_api
result = await self.call_function(
File "/home/anaconda3/envs/github-2/lib/python3.8/site-packages/gradio/blocks.py", line 1025, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/anaconda3/envs/github-2/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/anaconda3/envs/github-2/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/naconda3/envs/github-2/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/home/MyProject/Grounded-Segment-Anything-main/gradio_app.py", line 286, in run_grounded_sam
masks, _, _ = sam_predictor.predict_torch(
File "/home/anaconda3/envs/github-2/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/MyProject/Grounded-Segment-Anything-main/segment_anything/segment_anything/predictor.py", line 229, in predict_torch
low_res_masks, iou_predictions = self.model.mask_decoder(
File "/home/gukehan/anaconda3/envs/github-2/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/MyProject/Grounded-Segment-Anything-main/segment_anything/segment_anything/modeling/mask_decoder.py", line 94, in forward
masks, iou_pred = self.predict_masks(
File "/home/MyProject/Grounded-Segment-Anything-main/segment_anything/segment_anything/modeling/mask_decoder.py", line 144, in predict_masks
masks = (hyper_in @ upscaled_embedding.view(b, c, h * w)).view(b, -1, h, w)
RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 256, 256] because the unspecified dimension size -1 can be any value and is ambiguous

@lijain
Copy link

lijain commented Jun 2, 2023

+1

1 similar comment
@Dratlan
Copy link

Dratlan commented Jul 3, 2023

+1

@wanghao-cst
Copy link

I got the same issue:
RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 256, 256] because the unspecified dimension size -1 can be any value and is ambiguous

@chenminupup
Copy link

I got the same issue: RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 256, 256] because the unspecified dimension size -1 can be any value and is ambiguous

I got the same issue,can you solve it now?

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

7 participants