目录
1. pip install sam2
2. 编译安装
1. pip install sam2
运行报错:
cannot import name '_C' from 'sam2' (E:\project\smpl\render_blender\linux\GroundedSAM2_SMPL\sam2\__init__.py)
2. 编译安装
cd E:\project\sam2\sam2-main
set DISTUTILS_USE_SDK=1
python setup.py build_ext --inplace
报错:
running build_ext [WinError 2] 系统找不到指定的文件。 Failed to build the SAM 2 CUDA extension due to the error above. You can still use SAM 2 and it's OK to ignore the error above, although some post-processing functionality may be limited (which doesn't affect the results in most cases; (see https://github.com/facebookresearch/sam2/blob/main/INSTALL.md). 怎么解决
解决方法:
pip install --no-build-isolation -e .
参考:【SAM2本地编译部署】_sam2部署-CSDN博客