使用–recursive 进行克隆
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
下载下来后caffe-fast-rcnn文件夹为空,报错如下
Cloning into xxx...
remote: Enumerating objects: 23976, done.error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of xxx failed
Failed to clone 'caffe-fast-rcnn'. Retry scheduled
Cloning into xxx...
remote: Enumerating objects: 23976, done.
error: RPC failed; curl 56 OpenSSL SSL_read: Connection was reset, errno 10054
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of xxx failed
Failed to clone 'caffe-fast-rcnn' a second time, aborting
解决方法:
保留已下载部分,进入到所下载项目文件夹,执行git submodule update --init --recursive
cd py-faster-rcnn
git submodule update --init --recursive
结果显示如下,
Cloning into xxx...
Submodule path 'caffe-fast-rcnn': checked out '0dcd397b29507b8314e252e850518c5695efbb83'
再次检查caffe-fast-rcnn文件夹,出现内容。
下为 https://www.jianshu.com/p/f8a55b972972/ 中所述:
克隆一个包含子仓库的仓库目录,并不会clone下子仓库的文件,只是会克隆下.gitmodule描述文件,需要进一步克隆子仓库文件。
// 初始化本地配置文件
$ git submodule init
// 检出父仓库列出的commit
$ git submodule update
或者使用组合指令
$ git submodule update --init --recursive