PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
12.11k stars 2.94k forks source link

[Question]: AttributeError: module 'faiss' has no attribute 'swigfaiss_avx2' #7091

Closed tito-dt closed 10 months ago

tito-dt commented 1 year ago

请提出你的问题

报错信息

python examples/FAQ/dense_faq_example.py --device cpu
E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\_distutils_hack\__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
  File "E:\IdeaProjects\github_open_project\PaddleNLP\pipelines\examples\FAQ\dense_faq_example.py", line 19, in <module>
    from pipelines.document_stores import FAISSDocumentStore
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\__init__.py", line 39, in <module>
    from pipelines import utils
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\utils\__init__.py", line 15, in <module>
    from pipelines.utils.preprocessing import (  # isort: skip
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\utils\preprocessing.py", line 20, in <module>
    from pipelines.nodes.base import BaseComponent
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\nodes\__init__.py", line 49, in <module>
    from pipelines.nodes.reader import BaseReader, ErnieReader
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\nodes\reader\__init__.py", line 16, in <module>
    from pipelines.nodes.reader.ernie_dureader import ErnieReader
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\nodes\reader\ernie_dureader.py", line 28, in <module>
    from pipelines.document_stores import BaseDocumentStore
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\document_stores\__init__.py", line 40, in <module>
    FAISSDocumentStore = safe_import("pipelines.document_stores.faiss", "FAISSDocumentStore", "faiss")
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\utils\import_utils.py", line 39, in safe_import
    module = importlib.import_module(import_path)
  File "D:\softEnv\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\document_stores\faiss.py", line 49, in <module>
    class FAISSDocumentStore(SQLDocumentStore):
  File "E:\IdeaProjects\github_open_project\PaddleNLP\venv\lib\site-packages\pipelines\document_stores\faiss.py", line 66, in FAISSDocumentStore
    faiss_index: Union[dict, faiss.swigfaiss_avx2.IndexFlat] = None,
AttributeError: module 'faiss' has no attribute 'swigfaiss_avx2'

我的环境:

执行命令: python3 examples/FAQ/dense_faq_example.py --device cpu 无法使用conda,请问该如何处理

w5688414 commented 1 year ago

请参考:https://github.com/PaddlePaddle/PaddleNLP/issues/6815

tito-dt commented 1 year ago

请参考:#6815

这个看过了,因为我没使用conda,所以不太行,其他的包能装的都一致了,但还是有问题

w5688414 commented 1 year ago

请参考:#6815

这个看过了,因为我没使用conda,所以不太行,其他的包能装的都一致了,但还是有问题 建议使用miniconda,这样省事

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。