-
Notifications
You must be signed in to change notification settings - Fork 663
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
Segmentation fault when calling embeddings.index #744
Comments
Hello, thank you for writing in. This is a nagging issue for macs that is usually solved by the FAQ solution you mentioned. If you wouldn't mind, what happens if you change your code to this import faiss
faiss.omp_set_num_threads(1)
import txtai
embeddings = txtai.Embeddings()
embeddings.index(["Test", "Text"])
print(embeddings.search("positive", 1)) Do any of the options in this work? https://github.com/facebookresearch/faiss/wiki/Threads-and-asynchronous-calls |
Thanks @davidmezzetti for the suggestion! it unfortunately didn't work.
The suggested workaround also did not work; and still resulted in a segmentation fault. Are there other workarounds you could suggest? |
Setting that parameter has always worked. The error message seems like the same one as always that's solved with that ENV parameter. How about if you run this code? import faiss
import numpy as np
data = np.random.rand(100, 100)
index = faiss.index_factory(data.shape[1], "IDMap,Flat")
index.add_with_ids(data, np.arange(data.shape[0], dtype=np.int64))
print("Count =", index.ntotal) You can also try a different backend such as There are a number of upstream open issues related to this: https://github.com/kyamagu/faiss-wheels/issues |
Hmm I'm getting a seg fault when running |
If you're able to isolate that code with a simple install of I'm not sure why the known workaround that's worked in all previous cases doesn't work for your setup. It's the same issue that has been reported many times in the past. |
Also tried uninstalling faiss-cpu via Is there anything I can run (and please feel free to point me to the right repo/forum to ask if this isn't it!) on my machine to print details about my environment/installation etc that would be helpful? |
If you're able to reproduce this with just the code I provided with the conda install, I'd report it to the faiss project. |
Just wanted to follow up here. Did you end up reporting this to Faiss? |
Closing this due to inactivity. If there are further questions, please re-open or open a new issue. |
Hi there! I'm on an M1 mac and am trying to get up and running with txtai, starting with a simple script:
It seems like the code is getting to a seg fault on the index step - failing w/
segmentation fault python3 script.py
. Any idea what is going on here? I took a look at the common issues here: https://neuml.github.io/txtai/faq/#common-issues and followed steps under "Segmentation faults and similar errors on macOS" but exporting those global vars didn't work.The text was updated successfully, but these errors were encountered: