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

ValueError: zero-size array to reduction operation minimum which has no identity #50

Open
openwaterer opened this issue Jul 9, 2023 · 3 comments

Comments

@openwaterer
Copy link

When I enter segmentation prompt ,For example“girl” It will report an error.,
WechatIMG5

To create a public link, set share=True in launch().
[AgentScheduler] Task queue is empty
[AgentScheduler] Registering APIs
Startup time: 27.9s (import torch: 1.4s, import gradio: 1.3s, import ldm: 0.7s, other imports: 0.7s, load scripts: 6.8s, create ui: 13.7s, gradio launch: 2.5s, add APIs: 0.1s, app_started_callback: 0.5s).
Traceback (most recent call last):
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1323, in process_api
result = await self.call_function(
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/root/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/root/stable-diffusion-webui/extensions/PBRemTools/scripts/tools.py", line 32, in processing
processed = process_image(single_image, *rem_args)
File "/root/stable-diffusion-webui/extensions/PBRemTools/scripts/tools.py", line 80, in process_image
mask, image = get_foreground(image, *rem_args)
File "/root/stable-diffusion-webui/extensions/PBRemTools/scripts/td_abg.py", line 108, in get_foreground
mask = get_sa_mask(img, query, model_name, predicted_iou_threshold, stability_score_threshold, clip_threshold)
File "/root/stable-diffusion-webui/extensions/PBRemTools/scripts/sa_mask.py", line 168, in get_sa_mask
combined_mask = np.minimum.reduce(mask_list)
ValueError: zero-size array to reduction operation minimum which has no identity

@zhangwenhao666
Copy link

i got the same error ,don't know what's wrong.I filled in the keywords in the segmentation prompt column and reported an error

@wereretot
Copy link

@zhangwenhao666 The reason this error occurs is the model cannot find what you are trying to keep in the image. Try reducing "predicted_iou_threshold" and or "stability_score_threshold" and see if it helps.

@wereretot
Copy link

Also clip_threshold.

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