xy-guo / LIGA-Stereo

Code for LIGA-Stereo Detector, ICCV'21
Apache License 2.0
91 stars 18 forks source link

Tips on installing for pytorch>1.11, to avoid <THC/THC.h> bugs #19

Open sijieaaa opened 1 year ago

sijieaaa commented 1 year ago

If you find bugs about <THC/THC.h>, you can do the following modifications:

  1. uncomment this line: https://github.com/xy-guo/LIGA-Stereo/blob/aee3731a24a0ab1667e633e520cc89be2f135272/liga/ops/build_cost_volume/src/BuildCostVolume_cuda.cu#L5

  2. define a new ceil_div function:

    int  ceil_div(int a, int b){ 
    return  (a + b - 1) / b; 
    }
  3. replace this line: https://github.com/xy-guo/LIGA-Stereo/blob/aee3731a24a0ab1667e633e520cc89be2f135272/liga/ops/build_cost_volume/src/BuildCostVolume_cuda.cu#L232 with dim3 grid(std::min(ceil_div((long)(output_size / 2), 512), 4096));

  4. replace this line: https://github.com/xy-guo/LIGA-Stereo/blob/aee3731a24a0ab1667e633e520cc89be2f135272/liga/ops/build_cost_volume/src/BuildCostVolume_cuda.cu#L278 with dim3 grid(std::min(ceil_div((long)(grad.numel()), 512) , 4096));

  5. replace THCudaCheck(cudaGetLastError()); with AT_CUDA_CHECK(cudaGetLastError());