question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Process exits with status 139 when trying to instantiate a SentenceTransformer

See original GitHub issue

Description

Hi all, I’m running into a strange error while trying to run the following:

import sentence_transformers as st
encoder = st.SentenceTransformer("all-mpnet-base-v2")  # also tried sentence-t5-base

I get an error: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV), and if I run it as a script, I get zsh: segmentation fault python. I also get a warning: multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appears to be 1 leaked semaphore objects to clean up at shutdown.

Reproducibility

I’m afraid I don’t know how to reproduce this problem, it was working until it stopped working. Here are my specs:

  • MacBook Pro 2019, Intel Core i9, 32GB RAM
  • macOS Monterey 12.0.1
  • python 3.10.2
  • sentence_transformers==2.2.0
  • torch==1.11.0

What I’ve tried so far

  • Clear the cache from ~/.cache/torch/sentence_transformers
  • reinstall sentence_transformers (also tried downgrading to 2.1.0)
  • reinstalling torch
  • recreating my virtual environment
  • Rebooting

I’ve also managed to trace this problem to the following point in the torch codebase.

Any help would be appreciated, thanks in advance!

Update: I managed to fix the problem by downgrading to Python 3.9.11. I’m not actually sure whether the Python version is to be blamed here, or perhaps just having a new Python environment did the trick (perhaps the virtual environment wasn’t enough). Anyway, this isn’t really a solution but a workaround, so I think we should keep this ticket open.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nreimerscommented, May 18, 2022

These build on top of sentence Transformers. Python 3.10 is sadly still buggy with Pytorch, see https://github.com/pytorch/pytorch/issues/66424

So we have to wait until Python 3.10 is fully supported by Pytorch.

0reactions
ivan-riveracommented, May 18, 2022

@nreimers I just updated the issue with a workaround, but just in case this issue returns, can you recommend an alternative library that I could try? It seems to me that txtai and Top2Vec could be used to obtain sentence embeddings – would you say that these are reasonable alternatives?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Process exits with status 139 when trying to instantiate a ...
Description. Hi all, I'm running into a strange error while trying to run the following: import sentence_transformers as st encoder = st.
Read more >
Process finished with exit code 139 (interrupted by signal 11 ...
when i run from transformers import TapasForQuestionAnswering , then i meet error: Process finished with exit code 139 (interrupted by ...
Read more >
SentenceTransformer — Sentence-Transformers documentation
Loads or create a SentenceTransformer model, that can be used to map sentences / text ... If that fails, tries to construct a...
Read more >
Process finished with exit code 13… | Apple Developer Forums
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) I am getting a segmentation violation in Tensorflow running the Top2vec ...
Read more >
Incorporating Task-specific Concept Knowledge into Script Learning ...
Take “Make Eggless Cupcakes” as an example, the user might want to make it with ... The first method retrieves concepts of close...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found