From d8f8deb16b3bbd1296230aa30e971decbf090f33 Mon Sep 17 00:00:00 2001 From: Chuxwa <799586940@qq.com> Date: Sun, 29 Aug 2021 14:24:57 +0800 Subject: [PATCH 1/6] fix bugs of setup --- .vscode/c_cpp_properties.json | 16 ++++++++++++++++ pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py | 1 - .../pointnet2/pointnet2_3DSSD/src/ball_query.cpp | 8 ++++---- .../pointnet2_3DSSD/src/group_points.cpp | 4 ++-- .../pointnet2_3DSSD/src/interpolate.cpp | 6 +++--- .../pointnet2/pointnet2_3DSSD/src/sampling.cpp | 8 ++++---- .../ops/roiaware_pool3d/src/roiaware_pool3d.cpp | 4 ++-- pcdet/version.py | 2 +- tools/cfgs/dataset_configs/kitti_dataset.yaml | 2 +- 9 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 .vscode/c_cpp_properties.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..98d24c3 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu11", + "cppStandard": "gnu++14", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py index 6973be7..68b04c1 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py @@ -6,7 +6,6 @@ ext_modules=[ CUDAExtension('pointnet2_3DSSD_cuda', [ 'src/pointnet2_api.cpp', - 'src/ball_query.cpp', 'src/ball_query_gpu.cu', 'src/group_points.cpp', diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/ball_query.cpp b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/ball_query.cpp index 6c70258..3845592 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/ball_query.cpp +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/ball_query.cpp @@ -7,8 +7,8 @@ extern THCState *state; -#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") -#define CHECK_CONTIGUOUS(x) AT_CHECK(x.is_contiguous(), #x, " must be contiguous ") +#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") +#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x, " must be contiguous ") #define CHECK_INPUT(x) CHECK_CUDA(x);CHECK_CONTIGUOUS(x) int ball_query_wrapper_fast(int b, int n, int m, float radius, int nsample, @@ -19,7 +19,7 @@ int ball_query_wrapper_fast(int b, int n, int m, float radius, int nsample, const float *xyz = xyz_tensor.data(); int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); ball_query_kernel_launcher_fast(b, n, m, radius, nsample, new_xyz, xyz, idx, stream); return 1; } @@ -33,7 +33,7 @@ int ball_query_dilated_wrapper_fast(int b, int n, int m, float max_radius, float const float *xyz = xyz_tensor.data(); int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); ball_query_dilated_kernel_launcher_fast(b, n, m, max_radius, min_radius, nsample, new_xyz, xyz, idx, stream); return 1; } \ No newline at end of file diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/group_points.cpp b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/group_points.cpp index 6bb577d..430dc77 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/group_points.cpp +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/group_points.cpp @@ -15,7 +15,7 @@ int group_points_grad_wrapper_fast(int b, int c, int n, int npoints, int nsample const int *idx = idx_tensor.data(); const float *grad_out = grad_out_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); group_points_grad_kernel_launcher_fast(b, c, n, npoints, nsample, grad_out, idx, grad_points, stream); return 1; @@ -29,7 +29,7 @@ int group_points_wrapper_fast(int b, int c, int n, int npoints, int nsample, const int *idx = idx_tensor.data(); float *out = out_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); group_points_kernel_launcher_fast(b, c, n, npoints, nsample, points, idx, out, stream); return 1; diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/interpolate.cpp b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/interpolate.cpp index 6c1724c..b50fdbb 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/interpolate.cpp +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/interpolate.cpp @@ -18,7 +18,7 @@ void three_nn_wrapper_fast(int b, int n, int m, at::Tensor unknown_tensor, float *dist2 = dist2_tensor.data(); int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); three_nn_kernel_launcher_fast(b, n, m, unknown, known, dist2, idx, stream); } @@ -34,7 +34,7 @@ void three_interpolate_wrapper_fast(int b, int c, int m, int n, float *out = out_tensor.data(); const int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); three_interpolate_kernel_launcher_fast(b, c, m, n, points, idx, weight, out, stream); } @@ -49,6 +49,6 @@ void three_interpolate_grad_wrapper_fast(int b, int c, int n, int m, float *grad_points = grad_points_tensor.data(); const int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); three_interpolate_grad_kernel_launcher_fast(b, c, n, m, grad_out, idx, weight, grad_points, stream); } \ No newline at end of file diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/sampling.cpp b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/sampling.cpp index f29e15f..f275909 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/src/sampling.cpp +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/src/sampling.cpp @@ -14,7 +14,7 @@ int gather_points_wrapper_fast(int b, int c, int n, int npoints, const int *idx = idx_tensor.data(); float *out = out_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); gather_points_kernel_launcher_fast(b, c, n, npoints, points, idx, out, stream); return 1; } @@ -27,7 +27,7 @@ int gather_points_grad_wrapper_fast(int b, int c, int n, int npoints, const int *idx = idx_tensor.data(); float *grad_points = grad_points_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); gather_points_grad_kernel_launcher_fast(b, c, n, npoints, grad_out, idx, grad_points, stream); return 1; } @@ -40,7 +40,7 @@ int furthest_point_sampling_wrapper(int b, int n, int m, float *temp = temp_tensor.data(); int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); furthest_point_sampling_kernel_launcher(b, n, m, points, temp, idx, stream); return 0; } @@ -52,7 +52,7 @@ int furthest_point_sampling_with_dist_wrapper(int b, int n, int m, float *temp = temp_tensor.data(); int *idx = idx_tensor.data(); - cudaStream_t stream = THCState_getCurrentStream(state); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); furthest_point_sampling_with_dist_kernel_launcher(b, n, m, points, temp, idx, stream); return 2; } diff --git a/pcdet/ops/roiaware_pool3d/src/roiaware_pool3d.cpp b/pcdet/ops/roiaware_pool3d/src/roiaware_pool3d.cpp index 00edfef..e18fb69 100644 --- a/pcdet/ops/roiaware_pool3d/src/roiaware_pool3d.cpp +++ b/pcdet/ops/roiaware_pool3d/src/roiaware_pool3d.cpp @@ -11,8 +11,8 @@ All Rights Reserved 2019-2020. #include -//#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") -//#define CHECK_CONTIGUOUS(x) AT_CHECK(x.is_contiguous(), #x, " must be contiguous ") +//#define CHECK_CUDA(x) TORCH_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") +//#define CHECK_CONTIGUOUS(x) TORCH_CHECK(x.is_contiguous(), #x, " must be contiguous ") //#define CHECK_INPUT(x) CHECK_CUDA(x);CHECK_CONTIGUOUS(x) diff --git a/pcdet/version.py b/pcdet/version.py index 6e26f2c..60850ac 100644 --- a/pcdet/version.py +++ b/pcdet/version.py @@ -1 +1 @@ -__version__ = "0.3.0+a7cf536" +__version__ = "0.3.0+e5d6188" diff --git a/tools/cfgs/dataset_configs/kitti_dataset.yaml b/tools/cfgs/dataset_configs/kitti_dataset.yaml index 5e54723..7b8ed26 100644 --- a/tools/cfgs/dataset_configs/kitti_dataset.yaml +++ b/tools/cfgs/dataset_configs/kitti_dataset.yaml @@ -1,5 +1,5 @@ DATASET: 'KittiDataset' -DATA_PATH: '../data/kitti' +DATA_PATH: '/data/Dataset/KITTI/' POINT_CLOUD_RANGE: [0, -40, -3, 70.4, 40, 1] From 39a5a7f3bfe0b91e12bd0ebdc5434ff8b51fdfde Mon Sep 17 00:00:00 2001 From: Chuxwa <799586940@qq.com> Date: Sun, 29 Aug 2021 14:34:36 +0800 Subject: [PATCH 2/6] nothing --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index db2368d..30439af 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ venv/ *.pkl *.zip *.bin +.vscode + From f4fb419d8cf7189573daeb2024334a1144825213 Mon Sep 17 00:00:00 2001 From: Chuxwa <799586940@qq.com> Date: Sun, 29 Aug 2021 14:41:00 +0800 Subject: [PATCH 3/6] nothing --- .gitignore | 4 +--- .vscode/c_cpp_properties.json | 16 ---------------- pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py | 1 + 3 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 .vscode/c_cpp_properties.json diff --git a/.gitignore b/.gitignore index 30439af..4a82188 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,4 @@ venv/ *.so *.pkl *.zip -*.bin -.vscode - +*.bin \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 98d24c3..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**" - ], - "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "gnu11", - "cppStandard": "gnu++14", - "intelliSenseMode": "linux-gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py index 68b04c1..3da636e 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py @@ -5,6 +5,7 @@ name='pointnet2_3DSSD', ext_modules=[ CUDAExtension('pointnet2_3DSSD_cuda', [ + 'src/pointnet2_api.cpp', 'src/ball_query.cpp', 'src/ball_query_gpu.cu', From d703973dd00e357ac1b89969b636143f78e57da2 Mon Sep 17 00:00:00 2001 From: Chuxin Wang <60872928+Chuxwa@users.noreply.github.com> Date: Sun, 29 Aug 2021 14:42:57 +0800 Subject: [PATCH 4/6] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4a82188..db2368d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ venv/ *.so *.pkl *.zip -*.bin \ No newline at end of file +*.bin From d6697ece4bc8a7621cac2ff551e91cb3c78530c1 Mon Sep 17 00:00:00 2001 From: Chuxin Wang <60872928+Chuxwa@users.noreply.github.com> Date: Sun, 29 Aug 2021 14:45:03 +0800 Subject: [PATCH 5/6] Update setup.py --- pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py index 3da636e..6973be7 100644 --- a/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py +++ b/pcdet/ops/pointnet2/pointnet2_3DSSD/setup.py @@ -5,8 +5,8 @@ name='pointnet2_3DSSD', ext_modules=[ CUDAExtension('pointnet2_3DSSD_cuda', [ - 'src/pointnet2_api.cpp', + 'src/ball_query.cpp', 'src/ball_query_gpu.cu', 'src/group_points.cpp', From 8de8f30906c16b2b713bea6b9ee6cee3c272f658 Mon Sep 17 00:00:00 2001 From: Chuxwa <799586940@qq.com> Date: Sun, 29 Aug 2021 14:48:21 +0800 Subject: [PATCH 6/6] update kitti_dataset.yaml --- tools/cfgs/dataset_configs/kitti_dataset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cfgs/dataset_configs/kitti_dataset.yaml b/tools/cfgs/dataset_configs/kitti_dataset.yaml index 7b8ed26..5e54723 100644 --- a/tools/cfgs/dataset_configs/kitti_dataset.yaml +++ b/tools/cfgs/dataset_configs/kitti_dataset.yaml @@ -1,5 +1,5 @@ DATASET: 'KittiDataset' -DATA_PATH: '/data/Dataset/KITTI/' +DATA_PATH: '../data/kitti' POINT_CLOUD_RANGE: [0, -40, -3, 70.4, 40, 1]