资讯详情

【Pytorch】Paper reading:Deformable ConvNets v2(pytorch1.6编译)

📅 2026/10/22 12:22:44 | 华诺云谱 👁 阅读
【Pytorch】Paper reading:Deformable ConvNets v2(pytorch1.6编译)
Deformable ConvNets v21. 论文阅读目前文章只是粗略的看过一遍还不能写在博客里要等后续再读读恩先欠着吧2. pytorch1.6编译LZ其实是为了预研FairMOT论文然后需要配置dcnv2的环境期间当然不是一帆风顺的已经习惯了。。。其中有几个报错还是很多小伙伴会遇到的在github上也有很多类似的issue所以就重新开一篇毕竟也是一篇CVPR它值得的。DCNv2_new/src/cuda/dcn_v2_cuda.cu(107): error: identifier THCState_getCurrentStream is undefined DCNv2_new/src/cuda/dcn_v2_cuda.cu(279): error: identifier THCState_getCurrentStream is undefined DCNv2_new/src/cuda/dcn_v2_cuda.cu(324): error: identifier THCudaBlas_Sgemv is undefined使用原始代码里给的dcnv2会报如上的错误因为原始代码用的是conda install pytorch1.2.0 torchvision0.4.0 cudatoolkit10.0 -c pytorch而LZ是安装的pytorch1.6conda install pytorch torchvision cudatoolkit10.2 -c pytorch非得按照自己版本来结果就是得各种找问题后面是在github上https://github.com/jinfagang/DCNv2_latest找到了pytorch1.6版本的DCNv2版本后面运行make.sh应该是编译成功了的copying build/lib.linux-x86_64-3.8/_ext.cpython-38-x86_64-linux-gnu.so - Creating /root/anaconda3/envs/FairMOT/lib/python3.8/site-packages/DCNv2.egg-link (link to .) Adding DCNv2 0.1 to easy-install.pth file Installed /DCNv2_latest-pytorch1.6 Processing dependencies for DCNv20.1 Finished processing dependencies for DCNv20.1但是在test的时候又出现对应的问题python testcuda.py torch.Size([2, 64, 128, 128]) torch.Size([20, 32, 7, 7]) torch.Size([20, 32, 7, 7]) torch.Size([20, 32, 7, 7]) 0.971507, 1.943014 0.971507, 1.943014 Zero offset passed /root/anaconda3/envs/FairMOT/lib/python3.8/site-packages/torch/autograd/gradcheck.py:266: UserWarning: The {}th input requires gradient and is not a double precision floating point or complex. This check will likely fail if all the inputs are not of double precision floating point or complex. warnings.warn( check_gradient_dpooling: True Traceback (most recent call last): File testcuda.py, line 265, in module check_gradient_dconv() File testcuda.py, line 95, in check_gradient_dconv gradcheck(dcn_v2_conv, (input, offset, mask, weight, bias, File /root/anaconda3/envs/FairMOT/lib/python3.8/site-packages/torch/autograd/gradcheck.py, line 321, in gradcheck return fail_test(Backward is not reentrant, i.e., running backward with same File /root/anaconda3/envs/FairMOT/lib/python3.8/site-packages/torch/autograd/gradcheck.py, line 254, in fail_test raise RuntimeError(msg) RuntimeError: Backward is not reentrant, i.e., running backward with same input and grad_output multiple times gives different values, although analytical gradient matches numerical gradient. The tolerance for nondeterminism was 0.0.README.md中有一段Known Issues:Gradient check w.r.t offset (solved)Backward is not reentrant (minor)This is an adaption of the official Deformable-ConvNets.Update: all gradient check passes withdoubleprecision.Another issue is that it raisesRuntimeError: Backward is not reentrant. However, the error is very small (1e-7forfloat1e-15for double),so it may not be a serious problem (?)换句话说这个问题可以忽略那按照它对应的说法这算是编译完成可以使用了。参考地址论文地址https://arxiv.org/pdf/1811.11168.pdf
📝

华诺云谱内容团队

资深建站顾问 · 行业研究员

10年+企业数字化服务经验,专注智能建站、SEO优化与品牌营销,持续输出建站技巧、行业洞察与营销干货,已帮助5000+企业实现数字化增长。

你可能需要的服务

订阅华诺云谱资讯周报

每周一封,精选建站技巧、SEO与营销干货,直达邮箱。已有 8,000+ 企业主订阅,助你少走弯路。

↑