From 53b2b93d6613b8a6b2c8f624b7f33ca36d484607 Mon Sep 17 00:00:00 2001 From: Shaoshuai Shi Date: Wed, 25 Nov 2020 15:17:11 +0800 Subject: [PATCH] add contiguous() after transpose() at pointrcnn_head (#373) * bugfixed: ignore empty boxes in visualization * add contiguous() after transpose() at pointrcnn_head.py --- pcdet/models/dense_heads/anchor_head_multi.py | 2 +- pcdet/models/dense_heads/anchor_head_single.py | 2 +- pcdet/models/roi_heads/pointrcnn_head.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pcdet/models/dense_heads/anchor_head_multi.py b/pcdet/models/dense_heads/anchor_head_multi.py index 390131e51..f562e4328 100644 --- a/pcdet/models/dense_heads/anchor_head_multi.py +++ b/pcdet/models/dense_heads/anchor_head_multi.py @@ -150,7 +150,7 @@ def forward(self, spatial_features_2d): class AnchorHeadMulti(AnchorHeadTemplate): def __init__(self, model_cfg, input_channels, num_class, class_names, grid_size, point_cloud_range, - predict_boxes_when_training=True): + predict_boxes_when_training=True, **kwargs): super().__init__( model_cfg=model_cfg, num_class=num_class, class_names=class_names, grid_size=grid_size, point_cloud_range=point_cloud_range, predict_boxes_when_training=predict_boxes_when_training diff --git a/pcdet/models/dense_heads/anchor_head_single.py b/pcdet/models/dense_heads/anchor_head_single.py index 0abed8441..83c62cce9 100644 --- a/pcdet/models/dense_heads/anchor_head_single.py +++ b/pcdet/models/dense_heads/anchor_head_single.py @@ -6,7 +6,7 @@ class AnchorHeadSingle(AnchorHeadTemplate): def __init__(self, model_cfg, input_channels, num_class, class_names, grid_size, point_cloud_range, - predict_boxes_when_training=True): + predict_boxes_when_training=True, **kwargs): super().__init__( model_cfg=model_cfg, num_class=num_class, class_names=class_names, grid_size=grid_size, point_cloud_range=point_cloud_range, predict_boxes_when_training=predict_boxes_when_training diff --git a/pcdet/models/roi_heads/pointrcnn_head.py b/pcdet/models/roi_heads/pointrcnn_head.py index 84c778643..e03aa5038 100644 --- a/pcdet/models/roi_heads/pointrcnn_head.py +++ b/pcdet/models/roi_heads/pointrcnn_head.py @@ -147,7 +147,7 @@ def forward(self, batch_dict): pooled_features = self.roipool3d_gpu(batch_dict) # (total_rois, num_sampled_points, 3 + C) - xyz_input = pooled_features[..., 0:self.num_prefix_channels].transpose(1, 2).unsqueeze(dim=3) + xyz_input = pooled_features[..., 0:self.num_prefix_channels].transpose(1, 2).unsqueeze(dim=3).contiguous() xyz_features = self.xyz_up_layer(xyz_input) point_features = pooled_features[..., self.num_prefix_channels:].transpose(1, 2).unsqueeze(dim=3) merged_features = torch.cat((xyz_features, point_features), dim=1)