JialianW/TraDeS

Crashed building DCNv2

Closed this issue · 3 comments

When I compiled DCNv2 with gcc 7.5.0, it crashed because of some function undeclared errors. Does anybody meets similar errors?

TraDeS-master/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_cpu.cpp:224:9: error: ‘THFloatBlas_gemv’ was not declared in this scope
         THFloatBlas_gemv('t', k_, m_, 1.0f,
         ^~~~~~~~~~~~~~~~
TraDeS-master/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_cpu.cpp:224:9: note: suggested alternative: ‘THFloatBlas_gemm’
         THFloatBlas_gemv('t', k_, m_, 1.0f,
         ^~~~~~~~~~~~~~~~
         THFloatBlas_gemm
error: command 'g++' failed with exit status 1

Have you solved it?

You can try to change the code directly, THFloatBlas_gemv to THFloatBlas_gemm

This problem is caused by the version of the PyTorch and DCNv2. The original DCNv2 in this project is an old version that is not compatible with a high PyTorch version.

To solve this problem, you can copy an updated DCNv2 from another repo:

  1. git clone https://github.com/lbin/DCNv2.git && cd DCNv2/
  2. git checkout pytorch_1.9 or pytorch_1.8 or pytorch_1.7 (pytorch_1.9 branch also works for PyTorch 1.10 in my case)
  3. copy and add the class "DCN_TraDeS" in dcnv2.py of our project to the dcnv2.py of the new DCNv2.
  4. replace our DCNv2 with the new DCNv2
  5. Compile: . mask.sh