AdderNet: RuntimeError: _cdist_backward requires X2 to be contiguous
Hi, I am trying to train your addernet, but it returns me one runtime error, which I supposed attributes to .continuous()
function or some other uncommon operations used in your adder.py
.
Could you help to solve this issue?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18
@ranery I saw there are two
cdist()
implementations online (code 1 , code 2)This is because when calculating the gradient and error, current pytorch-based solution considers unfolding to collect and subtract corresponding block of both the feature map and weight filter, leading to unnecessary memory consumption, I suppose the way they use in their paper is cuda version which directly convolute through the feature map, in which way the memory consumption is normal (similar to multiplication-based convolution networks).