Skip to content

Commit

Permalink
fix: Fix reduce_mean and nms.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyYang0714 committed Jul 9, 2024
1 parent ab73be2 commit 59534e9
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion vis4d/common/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def reduce_mean(tensor: torch.Tensor) -> torch.Tensor:
if not (dist.is_available() and dist.is_initialized()):
return tensor
tensor = tensor.clone()
dist.all_reduce(tensor.div_(dist.get_world_size()), op=dist.ReduceOp.SUM)
dist.all_reduce(tensor.div_(get_world_size()), op=dist.ReduceOp.SUM)
return tensor


Expand Down
2 changes: 1 addition & 1 deletion vis4d/op/box/box2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def multiclass_nms(
labels = torch.arange(num_classes, dtype=torch.long, device=scores.device)
labels = labels.view(1, -1).expand_as(scores)

bboxes = bboxes.view(-1, 4)
bboxes = bboxes.reshape(-1, 4)
scores = scores.reshape(-1)
labels = labels.reshape(-1)

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/bevformer/bevformer_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""BEVFormer base with ResNet-101-DCN backbone."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import AdamW
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/bevformer/bevformer_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""BEVFormer tiny with ResNet-50 backbone."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import AdamW
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/cc_3dt/cc_3dt_frcnn_r101_fpn_kf3d_24e_nusc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""CC-3DT with Faster-RCNN ResNet-101 detector using KF3D motion model."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import SGD
from torch.optim.lr_scheduler import LinearLR, MultiStepLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/cc_3dt/cc_3dt_frcnn_r50_fpn_kf3d_12e_nusc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""CC-3DT with Faster-RCNN ResNet-50 detector using KF3D motion model."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import SGD
from torch.optim.lr_scheduler import LinearLR, MultiStepLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/cc_3dt/velo_lstm_bevformer_base_100e_nusc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""CC-3DT VeloLSTM for BEVFormer on nuScenes."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import Adam
from torch.optim.lr_scheduler import MultiStepLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/cc_3dt/velo_lstm_frcnn_r101_fpn_100e_nusc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""CC-3DT VeloLSTM on nuScenes."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch.optim import Adam
from torch.optim.lr_scheduler import MultiStepLR

Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/qdtrack/qdtrack_yolox_x_25e_bdd100k.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""QDTrack with YOLOX-x on BDD100K."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from lightning.pytorch.callbacks import ModelCheckpoint

from vis4d.config import class_config
Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/vit/vit_small_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""VIT ImageNet-1k training example."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch import nn
from torch.optim import AdamW
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR
Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/vit/vit_tiny_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""VIT ImageNet-1k training example."""
from __future__ import annotations

import pytorch_lightning as pl
import lightning.pytorch as pl
from torch import nn
from torch.optim import AdamW
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR
Expand Down

0 comments on commit 59534e9

Please sign in to comment.