【异常信息】
在DETR系列的代码环境配置过程中,在requirments.txt中常会有安装COCOAPI和panopticAPI,但是官方的代码常常是给以下的命令:
git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI&egg=pycocotools
git+https://github.com/cocodataset/panopticapi.git#egg=panopticapi
但是安装过程中,由于有些系统无法进行“科学上网”,所以会报异常:
fatal: unable to access 'https://github.com/cocodataset/cocoapi.git/': Empty reply from server
error: subprocess-exited-with-error
× git clone --quiet https://github.com/cocodataset/cocoapi.git /tmp/pip-install-mht0kgow/pycocotools_bde956953d94413f88636203cd823671 did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× git clone --quiet https://github.com/cocodataset/cocoapi.git /tmp/pip-install-mht0kgow/pycocotools_bde956953d94413f88636203cd823671 did not run successfully.
│ exit code: 128
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
【问题解决】
1.COCOAPI
针对COCOAPI的安装问题,主要有两种途径,其实我在之前的博文中有提到点击访问,这里我还是推荐较简单的安装方法,即直接在Pycocotools清华源链接,https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools/ 下载所需版本的 pycocotools.whl 文件即可.
然后将其在目标环境中直接,即可成功安装
pip install pycocotools**.whl
2. panoptic API
可直接访问panoptic的github主页点击访问,https://github.com/cocodataset/panopticapi#egg=panopticapi
然后直接下载原代码,最好zip结尾吧。
然后将源码zip压缩包,上传至对应文件夹,在对应的虚拟环境中使用 pip install pan*.zip 即可成功安装。