X-anylabelIng运行自动标注报错cannot import name ‘_C‘ from ‘sam2‘解决
这个报错是由于Segment Anything 2video里面需要的依赖没有安装正确,根据教程:
Before you begin, make sure you have the following prerequisites installed:
Step 0: Download and install Miniconda from the official website.
Step 1: Create a new Conda environment with Python version 3.10 or higher, and activate it:
conda create -n x-anylabeling-sam2 python=3.10 -y conda activate x-anylabeling-sam2
You'll need to install SAM2 first. The code requires torch>=2.3.1 and torchvision>=0.18.1. Follow the instructions here to install both PyTorch and TorchVision dependencies.
Afterward, you can install SAM2 on a GPU-enabled machine using:
git clone https://github.com/CVHub520/segment-anything-2 cd segment-anything-2 pip install -e .
结果没有找到_C.pyd在源码编译时候,于是使用
重新运行您的编译命令:python setup.py build_ext --inplace
找到_C.pyd然后放进安装环境中sam2文件夹即可即可问题。
【参考文献】
https://blog.csdn.net/2203_75822642/article/details/140905388
