我目前正在尝试安装 Apple 的 Ferret 计算机视觉模型,并按照其 github 页面上提供的文档进行操作。运行时pip install flash-attn --no-build-isolation
我抛出这个错误:
Collecting flash-attn
Using cached flash_attn-2.5.0.tar.gz (2.5 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
fatal: not a git repository (or any of the parent directories): .git
/private/var/folders/q4/6n8875qj00l8ct6c5ms6y7dw0000gn/T/pip-install-cbzesfg4/flash-attn_07733c481d0948b3a44285f30d59fa03/setup.py:78: UserWarning: flash_attn was requested, but nvcc was not found. Are you sure your environment has nvcc available? If you're installing within a container from https://hub.docker.com/r/pytorch/pytorch, only images whose names contain 'devel' will provide nvcc.
warnings.warn(
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/q4/6n8875qj00l8ct6c5ms6y7dw0000gn/T/pip-install-cbzesfg4/flash-attn_07733c481d0948b3a44285f30d59fa03/setup.py", line 133, in <module>
CUDAExtension(
File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1076, in CUDAExtension
library_dirs += library_paths(cuda=True)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1203, in library_paths
if (not os.path.exists(_join_cuda_home(lib_dir)) and
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 2416, in _join_cuda_home
raise OSError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
torch.__version__ = 2.1.2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
我为雪貂设置的 anaconda 环境是否有问题?我尝试使用 MAX_JOBS==1 标志来运行它来缓解运行问题,但这只产生了相同的结果。还尝试使用指定版本的 flash-attn 运行它,但它产生的结果与以前相同。如果我的电脑规格有问题,我会在配备 Intel Iris Graphics 550 1536 MB GPU 和 2.9 GHz 双核 Intel Core i5 CPU 以及 8Gb RAM 的 Macbook Pro 2016 上使用 MacOS 运行此程序。
如有任何帮助或建议,我们将不胜感激!