Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PonitRCNN GPU memory occupancy problem #1928

Merged
merged 4 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/en/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

#### Contributors

A total of 9 developers contributed to this release.
A total of 11 developers contributed to this release.

@ZwwWayne, @Tai-Wang, @filaPro, @VVsssssk, @ZCMax, @Xiangxu-0103, @holtvogt, @tpoisonooo, @lianqing01
@ZwwWayne, @Tai-Wang, @filaPro, @VVsssssk, @ZCMax, @Xiangxu-0103, @holtvogt, @tpoisonooo, @lianqing01, @TommyZihao, @aditya9710

### v1.0.0rc4 (8/8/2022)

Expand Down
5 changes: 2 additions & 3 deletions mmdet3d/models/roi_heads/bbox_heads/point_rcnn_bbox_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def init_weights(self):
nn.init.constant_(m.bias, 0)
normal_init(self.conv_reg.weight, mean=0, std=0.001)

def forward(self, feats):
def forward(self, input_data):
"""Forward pass.

Args:
Expand All @@ -212,9 +212,8 @@ def forward(self, feats):
Returns:
tuple[torch.Tensor]: Score of class and bbox predictions.
"""
input_data = feats.clone().detach()
xyz_input = input_data[..., 0:self.in_channels].transpose(
1, 2).unsqueeze(dim=3).contiguous().clone().detach()
1, 2).unsqueeze(dim=3).contiguous()
xyz_features = self.xyz_up_layer(xyz_input)
rpn_features = input_data[..., self.in_channels:].transpose(
1, 2).unsqueeze(dim=3)
Expand Down
2 changes: 1 addition & 1 deletion mmdet3d/models/roi_heads/point_rcnn_roi_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def forward_train(self, feats_dict, input_metas, proposal_list,
point_cls_preds = feats_dict['points_cls_preds']
sem_scores = point_cls_preds.sigmoid()
point_scores = sem_scores.max(-1)[0]

sample_results = self._assign_and_sample(proposal_list, gt_bboxes_3d,
gt_labels_3d)

Expand Down Expand Up @@ -211,6 +210,7 @@ def _bbox_forward(self, features, points, batch_size, rois):
bbox_results = dict(cls_score=cls_score, bbox_pred=bbox_pred)
return bbox_results

@torch.no_grad()
def _assign_and_sample(self, proposal_list, gt_bboxes_3d, gt_labels_3d):
"""Assign and sample proposals for training.

Expand Down
9 changes: 8 additions & 1 deletion tests/test_models/test_heads/test_parta2_bbox_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
import pytest
import torch
from mmcv import Config
from mmcv.ops import SubMConv3d

from mmdet3d.ops.spconv import IS_SPCONV2_AVAILABLE

if IS_SPCONV2_AVAILABLE:
from spconv.pytorch import SubMConv3d
else:
from mmcv.ops import SubMConv3d

from torch.nn import BatchNorm1d, ReLU

from mmdet3d.core.bbox import Box3DMode, LiDARInstance3DBoxes
Expand Down