Commit cddcf9ba authored by Shaoshuai Shi's avatar Shaoshuai Shi
Browse files

move spconv_utils.py to pcdet/utils/, update find_all_spconv_keys()

parent 511244e2
...@@ -2,7 +2,7 @@ from functools import partial ...@@ -2,7 +2,7 @@ from functools import partial
import torch.nn as nn import torch.nn as nn
from ...spconv_utils import replace_feature, spconv from ...utils.spconv_utils import replace_feature, spconv
def post_act_block(in_channels, out_channels, kernel_size, indice_key=None, stride=1, padding=0, def post_act_block(in_channels, out_channels, kernel_size, indice_key=None, stride=1, padding=0,
......
...@@ -3,7 +3,7 @@ from functools import partial ...@@ -3,7 +3,7 @@ from functools import partial
import torch import torch
import torch.nn as nn import torch.nn as nn
from ...spconv_utils import replace_feature, spconv from ...utils.spconv_utils import replace_feature, spconv
from ...utils import common_utils from ...utils import common_utils
from .spconv_backbone import post_act_block from .spconv_backbone import post_act_block
......
...@@ -3,7 +3,7 @@ import torch ...@@ -3,7 +3,7 @@ import torch
import torch.nn as nn import torch.nn as nn
from ...ops.roiaware_pool3d import roiaware_pool3d_utils from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...spconv_utils import spconv from ...utils.spconv_utils import spconv
from .roi_head_template import RoIHeadTemplate from .roi_head_template import RoIHeadTemplate
......
...@@ -16,7 +16,7 @@ def find_all_spconv_keys(model: nn.Module, prefix="") -> Set[str]: ...@@ -16,7 +16,7 @@ def find_all_spconv_keys(model: nn.Module, prefix="") -> Set[str]:
for name, child in model.named_children(): for name, child in model.named_children():
new_prefix = f"{prefix}.{name}" if prefix != "" else name new_prefix = f"{prefix}.{name}" if prefix != "" else name
if isinstance(child, (spconv.SubMConv3d, spconv.SparseConv3d, spconv.SparseInverseConv3d)): if isinstance(child, spconv.conv.SparseConvolution):
new_prefix = f"{new_prefix}.weight" new_prefix = f"{new_prefix}.weight"
found_keys.add(new_prefix) found_keys.add(new_prefix)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment