mmdetection填坑

mmdetection安装

1. 我是在docker中使用的,直接有镜像pytorch1.2.0和cuda10,因此,按照GitHub中 open-mmlab mmdetection提供的install.md,直接跳到下载mmdetection这一步,我是直接在github上下载的压缩包,和用git应该差不多,然后cd到mmdetection文件夹,注意,后续我使用的是pip install -v -e .(python setup.py develop我用了没用,不知道为什么)

可能会遇到下载超时问题:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read

timed out.

--default-timeout=1000 # 1000是时间 可调

解决方案: https://yq.aliyun.com/articles/619208

2. 然后训练,三个so文件找不到,参考该网址:https://blog.csdn.net/liuyingying0418/article/details/84580254

# Install
$ apt-get update
$ apt-get install apt-file
# Update apt-file
$ apt-file update
apt-get install libsm6
apt-get install libxrender1
apt-get install libgl1

 ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory:

apt-get install libglib2.0-0

3. 后,报错:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [303, 256, 7, 7]], which is output 0 of IndexPutBackward, is at version 3; expected version 2 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

这个问题搞了几个小时,之前pytorch1.1.0时未出现过,查阅之后发现这是pytorch1.2.0才出现的(网上也有是0.3.0到0.4.0 variable和tensor合并出现的问题),github作者给出了修改:https://github.com/open-mmlab/mmdetection/pull/1160/commits/f64910bd4a560232bc40310f8e724ec8ce42c8e3

+=是inplace操作,即应把x+=1形式改成x=x+1,我依照网上改成

roi_feats[inds] = roi_feats[inds] + roi_feats_t
仍会报错,是因为roi_feats[inds]全是零吗,希望知道的人能给我解答

ps: 代码中其他有+=的部分又没有问题,脑壳疼

 

4. 开跑了之后,存储模型时又出现了这个问题,

File "/root/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/utils/path.py", line 49, in symlink
os.symlink(src, dst, **kwargs)
OSError: [Errno 95] Operation not supported: 'epoch_1.pth' -> '/test/competition/cloth/mmdetection/work_dirs/ga_retinanet_x101_32x4d_fpn_1x/latest.pth'

具体原因我也不清楚,但可以确定的是创建软连接的问题,让latest.pth指向当前存储的模型epoch_x.pth,对我来说可有可无,所以我就把这句话注释掉了,有更好的解决方法希望万能网友告诉我。

https://github.com/open-mmlab/mmdetection/issues/1371

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值