chengdazhi / Deformable-Convolution-V2-PyTorch

Deformable ConvNets V2 (DCNv2) in PyTorch
MIT License
1.45k stars 230 forks source link

depriciated torch.utils.ffi used #64

Open research-boy opened 4 years ago

research-boy commented 4 years ago

Traceback (most recent call last): File "build.py", line 3, in from torch.utils.ffi import create_extension File "/usr/local/lib/python3.6/dist-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.") ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead. Traceback (most recent call last): File "build_modulated.py", line 3, in from torch.utils.ffi import create_extension File "/usr/local/lib/python3.6/dist-packages/torch/utils/ffi/init.py", line 1, in raise ImportError("torch.utils.ffi is deprecated. Please use cpp extensions instead.") ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.

JamesZhan107 commented 4 years ago

Have you solved this problem? @research-boy

research-boy commented 4 years ago

@JamesZhan107 Not yet, let me know if you can help me with this

JamesZhan107 commented 4 years ago

@JamesZhan107 Not yet, let me know if you can help me with this

https://github.com/ruinmessi/ASFF/tree/09f558863ae297663ec476f52a90c0cf6881415e/utils/DCN This repo used dcnv2 and has modified the module. It can be complied.

chengdazhi commented 4 years ago

If you guys are using more up to date pytorch, you can checkout the deformable conv module in mmdetection repo.

JamesZhan107 commented 4 years ago

‘’‘ inputs = Variable(torch.randn(N, inC, inH, inW).cuda(), requires_grad=True) offset = conv(inputs)

offset = Variable(torch.randn(N, num_deformable_groups 2 kH * kW, inH, inW).cuda(), requires_grad=True)

output = conv_offset2d(inputs, offset) ‘’’ As is shown in test.py, are these two inputs the same? @chengdazhi

chengdazhi commented 4 years ago

Yep

JamesZhan107 commented 4 years ago

Yep

OK, Thanks you !

herbertcai commented 3 years ago

Hi @chengdazhi,

I tried the DCN from here: https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/tree/mmdetection/mmdet/ops/dcn. It still gives the depreciation error. I then went to the official mmdetection repo https://github.com/open-mmlab/mmdetection, but couldn't find the DCN module. Could you point me to the right location?

Thanks!