-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am getting this error when i do pip install -e . #99
Comments
Same, Have tried a lot of different steps to try and resolve including explicitly setting CUDA_HOME before running & get the same error |
Set the path of CUDA_HOME on environment variables > on VS Code, change the default terminal pressing CTRL + SHIFT + P and typing "Terminal: Select Default Profile" and select Command Prompt. Worked for me |
Tried this. Still got same error. :( |
Try doing these steps but using a conda environment, so you will need to install the dependencies using conda as well. |
Same issue here on WIn10 :-( I get it working on WSL after installing CUDA TOOLKIT for Linux... |
follow this video https://www.youtube.com/watch?v=MIUxiLjoA1g worked for me |
This is referring to https://github.com/facebookresearch/segment-anything-2/issues/137 , which in itself refers to a common problem during installation, mentioned on https://github.com/facebookresearch/segment-anything-2/issues/19 . Some users may encounter significant trouble installing the project, running into the error `OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.`. Simply adding the `--no-build-isolation` flag to the pip install, e.g. `pip install --no-build-isolation -e .`, usually solves this problem. However, this fix is not mentioned anywhere within the readmes or installation troubleshooting docs. This PR adds this recommendation into the INSTALL.md file under the "My installation failed with `CUDA_HOME environment variable is not set` " section, ensuring that more users are aware of this potential fix. Examples of users experiencing related difficulties when installing: https://github.com/facebookresearch/segment-anything-2/issues/19 https://github.com/facebookresearch/segment-anything-2/issues/41 https://github.com/facebookresearch/segment-anything-2/issues/99 https://github.com/facebookresearch/segment-anything-2/issues/133
👇👇 How to Apply UTF-8 for Non-Unicode Programs in Windows 11
|
Hi, this is likely due to an error in building the SAM 2 CUDA extension. We have recently made the CUDA extension step optional (in https://github.com/facebookresearch/segment-anything-2/pull/155 and https://github.com/facebookresearch/segment-anything-2/pull/175) as a workaround to this problem. You can pull the latest code and reinstall via # run the line below inside the SAM 2 repo
git pull;
pip uninstall -y SAM-2;
rm -f sam2/*.so;
pip install -e ".[demo]" which allows using SAM 2 without CUDA extension (the results should stay the same in most cases, see |
Without using CUDA, I'm still able to use the GPU to segment ? |
@MiessiGomes Yes, you should still be able to use GPUs (it's just that the post-processing step based on the custom SAM 2 CUDA extension will be skipped, which shouldn't affect results in most cases) |
Thanks dude
|
error: subprocess-exited-with-error
Getting requirements to build editable did not run successfully.
exit code: 1
[32 lines of output]
C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\torch_subclasses\functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_numpy.cpp:84.)
cpu = _conversion_method_template(device=torch.device("cpu"))
Traceback (most recent call last):
File "C:\Users\varun\anaconda3\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\varun\anaconda3\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\anaconda3\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 132, in get_requires_for_build_editable
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 458, in get_requires_for_build_editable
return self.get_requires_for_build_wheel(config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
exec(code, locals())
File "", line 70, in
File "", line 51, in get_extensions
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\torch\utils\cpp_extension.py", line 1076, in CUDAExtension
library_dirs += library_paths(cuda=True)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\site-packages\torch\utils\cpp_extension.py", line 1214, in library_paths
paths.append(_join_cuda_home(lib_dir))
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\varun\AppData\Local\Temp\pip-build-env-62f8d4eb\overlay\Lib\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.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
Getting requirements to build editable did not run successfully.
exit code: 1
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
The text was updated successfully, but these errors were encountered: