facebookresearch / facebookresearch/sam2

My solution when it failed installing

Open
#54 5 comments 6 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I am tired to explain everything so here it's what I did:

First install CUDA 12.5 (cuda cuda cuda cuda 🎶)

https://developer.nvidia.com/cuda-downloads

Then:

`git clone git@github.com:facebookresearch/segment-anything-2.git`

`cd segment-anything-2`

Next:
`pip install wheel setuptools`
`pip install ninja`

why ninja? well... got this error:
`UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja..`
(don't ask me, ask who wrote this code that asks for ninjas 🥷)

Are you using a venv? (virtual environment)
then check nvcc version:

`nvcc --version`

12.* ? then you are good to go and use `pip install -e .`

not 12.*? then check where cuda is installed:

`ls /usr/local/`

are you seeing the cuda folder like this?:

`bin cuda cuda-12 cuda-12.5 etc games include lib man sbin share src`

then do this:

`export PATH=/usr/local/cuda-12.5/bin${PATH:+:${PATH}}`
`export LD_LIBRARY_PATH=/usr/local/cuda-12.5/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}`

deactivate your environment and activate it again.
then:

`pip install -e .`

You happy? leave a like.
Unhappy? I tried ok?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.