1.首先几步跟官网一样
conda create --name maskrcnn_benchmark python==3.8(建议装3.8,好装pytorch) conda activate maskrcnn_benchmark # this installs the right pip and dependencies for the fresh python conda install ipython pip # maskrcnn_benchmark and coco api dependencies pip install ninja yacs cython matplotlib tqdm opencv-python 正常安装所需要的库 然后安装所需要的toch环境 以我的为例,我的是cuda11.3
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
2.然后安装cocoapi
git clone https://github.com/cocodataset/cocoapi.git cd cocoapi/PythonAPI 需要setup.py删掉参数 修改成这样,然后再 python setup.py build_ext install
3.接下来安装apex
git clone https://github.com/ptrblck/apex.git
cd apex
git checkout apex_no_distributed
pip install -v --no-cache-dir ./
4.最后下载源码
git clone https://github.com/facebookresearch/maskrcnn-benchmark.git cd maskrcnn-benchmark 此外需要修改编译的代码 将这个文件替换掉修改过的 该文件我将放在百度网盘链接链接:https://pan.baidu.com/s/1dvUhutmcsVTkFpFqUg34Ww?pwd=cbwf 提取码:cbwf python setup.py build develop 就安装成功了 如果有其他报错的可以在评论区提问标签:git,install,extension,python,mask,benchmark,maskrcnn,objects,https From: https://blog.csdn.net/weixin_47616935/article/details/139391404