Skip to content

Commit

Permalink
[Fix]Fix support for devices other than Cuda.
Browse files Browse the repository at this point in the history
  • Loading branch information
LRJKD committed Oct 13, 2023
1 parent 0f9dfa9 commit d154b45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmdet3d/models/dense_heads/free_anchor3d_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Dict, List

import torch
from mmengine.device import get_device
from torch import Tensor
from torch.nn import functional as F

Expand Down Expand Up @@ -79,7 +80,9 @@ def loss_by_feat(
featmap_sizes = [featmap.size()[-2:] for featmap in cls_scores]
assert len(featmap_sizes) == self.prior_generator.num_levels

anchor_list = self.get_anchors(featmap_sizes, batch_input_metas)
device = get_device()
anchor_list = self.get_anchors(featmap_sizes, batch_input_metas,
device)
mlvl_anchors = [torch.cat(anchor) for anchor in anchor_list]

# concatenate each level
Expand Down

0 comments on commit d154b45

Please sign in to comment.