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

UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown #40

Open
mehtaabGill opened this issue Oct 16, 2024 · 1 comment

Comments

@mehtaabGill
Copy link

Recently ran into an issue while using fashion-clip on a non-cuda device (Apple M1 Mac).

Error:

/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254:
UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown

Steps to recreate:

run this script on a device without cuda available

from fashion_clip.fashion_clip import FashionCLIP

model = FashionCLIP("fashion-clip")

def embed_text(description):
    text_embedding = model.encode_text([description], 1).flatten().tolist()
    return text_embedding
    
embed_text("Black Dress")

Expected result:

Successful embedding

Current result:

/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/transformers/tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
  warnings.warn(
Map: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 142.35 examples/s]
  0%|                                                                                                                                              | 0/1 [00:00<?, ?it/s]Bus error: 10
/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: 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 '

Additonal context:

This issue is relatively new (within the last 6-7 days). I have had this script working for several weeks but when I went to run it a few days ago, I noticed it took extra long to start (perhaps downloading new resources), and I haven't been able to get it to work since then. Additionally, the script works flawlessly on my Windows PC with cuda available.

@mehtaabGill
Copy link
Author

Update:

Downgrading to torch==1.11.0 and numpy<2 resolves this issue.

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