我正在做一个使用transformers 2.2.2的项目,如果我用
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
应用程序运行没有任何问题。
我正在将项目转换为Poetry,但当我使用Poetry创建虚拟环境并运行应用程序时,我遇到了以下错误:
Traceback (most recent call last):
File "app/main.py", line 12, in <module>
from app.src.common.utils import get_categories, get_models
File "/home/mdonato/Documents-backup/jobs-data-analysis/app/src/common/utils.py", line 10, in <module>
from sentence_transformers import SentenceTransformer
File "/home/mdonato/Documents-backup/jobs-data-analysis/.venv/lib/python3.8/site-packages/sentence_transformers/__init__.py", line 3, in <module>
from .datasets import SentencesDataset, ParallelSentencesDataset
File "/home/mdonato/Documents-backup/jobs-data-analysis/.venv/lib/python3.8/site-packages/sentence_transformers/datasets/__init__.py", line 1, in <module>
from .DenoisingAutoEncoderDataset import DenoisingAutoEncoderDataset
File "/home/mdonato/Documents-backup/jobs-data-analysis/.venv/lib/python3.8/site-packages/sentence_transformers/datasets/DenoisingAutoEncoderDataset.py", line 1, in <module>
from torch.utils.data import Dataset
File "/home/mdonato/Documents-backup/jobs-data-analysis/.venv/lib/python3.8/site-packages/torch/__init__.py", line 229, in <module>
from torch._C import * # noqa: F403
ImportError: libcupti.so.11.7: cannot open shared object file: No such file or directory
我遵循this指南来指导NVIDIA驱动程序、CUDA和cuDNN。我还遵循焦油文件安装,所以我试图安装在两种方式,但我仍然有同样的错误。
1条答案
按热度按时间ymdaylpp1#
有一个类似的问题here,解决了修复
torch<2.0.1
。在构建Nvidia base image的推理Docker映像时,同样的解决方案对我有效。您的package没有 Torch 版本的上限。你可能正在安装
2.0.1
,这也给了我你看到的错误。