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

[Bug]: MacOS M1 , "There appear to be 1 leaked semaphore objects to clean up at shutdown" #16

Closed
2 tasks done
buliuguyy opened this issue Apr 12, 2023 · 5 comments
Closed
2 tasks done

Comments

@buliuguyy
Copy link

buliuguyy commented Apr 12, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

Have you updated WebUI and this extension to the newest version?

  • I have updated WebUI and this extension to the most up-to-date version

What happened?

When I use this plugin on mac(M1 Apple core), this error occurs even with the ViT-B SAM model with the smallest amount of parameters. Is this problem caused by insufficient video memory? If so, is it because there is no support for mac to reason through the cpu?

Steps to reproduce the problem

  1. Go to img2img generation
  2. Press segment anything tab
  3. Upload img and set black and red point
  4. Choose one sam model
  5. Press “Preview Segmentation”

What should have happened?

Properly Segmented images

Commit where the problem happens

webui: 22bcc7be428c94e9408f589966c2040187245d81
extension: c9340671 (Sat Mar 11 01:01:43 2023)

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

In webui-user.sh
export COMMANDLINE_ARGS="--skip-version-check --upcast-sampling --no-half-vae --skip-torch-cuda-test --no-half  --no-half-controlnet --use-cpu interrogate --api"

Console logs

Initializing SAM
Running SAM Inference (638, 918, 3)
/AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphExecutable.mm:1377: failed assertion `Incompatible element type for parameter at index 0, mlir module expected element type f32 but received si32'
zsh: abort      ./webui.sh
buliuguyy@luyinyudeMacBook-Pro stable-diffusion-webui % /opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

Additional information

No response

@buliuguyy buliuguyy changed the title [Bug]: MacOS M2, "There appear to be 1 leaked semaphore objects to clean up at shutdown" [Bug]: MacOS M1 , "There appear to be 1 leaked semaphore objects to clean up at shutdown" Apr 12, 2023
@ccokme
Copy link

ccokme commented Apr 17, 2023

same issue on M1.

@sunddytwo
Copy link

same issue on M2, MacOS Ventura vesion13.3

@D-Dora
Copy link

D-Dora commented Apr 27, 2023

same issue on M1.

@twinkpig
Copy link

same issue on M1. WebUI main process will interrupt.

@blu3gui7ar
Copy link

facebookresearch/segment-anything#94
facebookresearch/segment-anything#122

Seems related to mps support bug.

--use-cpu all Solves the problem. But MPS support is better if available.

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