[doc] Check and raise an error if the user is running Python from the parent directory of the sam2 repo (#359)
If the user has "sam2/sam2" in their path, they are likey importing the repo itself as "sam2" rather than importing the "sam2" python package (i.e. "sam2/sam2" directory). This typically happens because the user is running Python from the parent directory that contains the sam2 repo they cloned. In general, the user should not run Python from the parent dir when the repo is cloned into (same is true for e.g. Numpy repo that contains names like `numpy/numpy` where the module and the repo have the same name), as the user encountered in https://github.com/facebookresearch/sam2/issues/346. (close https://github.com/facebookresearch/sam2/issues/346)
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
SAM 2 needs to be installed first before use. The code requires `python>=3.10`, as well as `torch>=2.3.1` and `torchvision>=0.18.1`. Please follow the instructions [here](https://pytorch.org/get-started/locally/) to install both PyTorch and TorchVision dependencies. You can install SAM 2 on a GPU machine using:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/facebookresearch/sam2.git
|
||||
git clone https://github.com/facebookresearch/sam2.git && cd sam2
|
||||
|
||||
cd sam2 & pip install -e .
|
||||
pip install -e .
|
||||
```
|
||||
If you are installing on Windows, it's strongly recommended to use [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) with Ubuntu.
|
||||
|
||||
|
Reference in New Issue
Block a user