Skip to content

Commit

Permalink
Fix LRSchedulerWrapper with shared memory address issue. (#135)
Browse files Browse the repository at this point in the history
* fix: Fix LRSchedulerWrapper with shared memory address issue.

* feat: update workflows, test data, and remove torch.jit

* feat: lint the files.

* fix: Fix mypy error.
  • Loading branch information
RoyYang0714 authored Apr 10, 2024
1 parent 93f5c41 commit b25086f
Show file tree
Hide file tree
Showing 448 changed files with 672 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions tests/common/ckpt_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test checkpoint."""

from vis4d.common.ckpt import get_torchvision_models, load_from_torchvision


Expand Down
1 change: 1 addition & 0 deletions tests/common/imports_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test imports."""

import unittest

from vis4d.common.imports import package_available
Expand Down
1 change: 1 addition & 0 deletions tests/common/logging_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test logging."""

import logging
import os
import shutil
Expand Down
1 change: 1 addition & 0 deletions tests/common/named_tuple_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test named tuple."""

import unittest
from collections import namedtuple

Expand Down
1 change: 1 addition & 0 deletions tests/common/prettyprint_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for pretty printing."""

import unittest
from typing import Any

Expand Down
1 change: 1 addition & 0 deletions tests/common/progress_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for progress bar."""

import unittest

import torch
Expand Down
1 change: 1 addition & 0 deletions tests/common/time_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for time."""

import time
import unittest
from io import StringIO
Expand Down
1 change: 1 addition & 0 deletions tests/config/common/datasets/bdd100k/detect_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcase for default data pipelines for detection."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/config/common/datasets/bdd100k/sem_seg_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcase for default data pipelines for segmentation."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/config/common/datasets/coco/detection_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for dataset and dataloader using COCO."""

from __future__ import annotations

import unittest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test NuScenes monocular dataset config."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/config/common/datasets/nuscenes/nuscenes_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test NuScenes multi-sensor video dataset config."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/config/common/datasets/shift/test_shift_tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for dataset and dataloader using COCO."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/config/registry_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test config registry."""

from __future__ import annotations

import unittest
Expand Down
5 changes: 2 additions & 3 deletions tests/config/show_connection_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Show config connection tests."""

import unittest

from tests.zoo.util import content_equal, get_config_for_name
Expand All @@ -24,9 +25,7 @@ def test_show_frcnn(self) -> None:
model = instantiate_classes(config.model)

# Change the data root of evaluator callback to the test data
config.callbacks[
3
].init_args.evaluator.init_args.data_root = (
config.callbacks[3].init_args.evaluator.init_args.data_root = (
"tests/vis4d-test-data/coco_test"
)
config.callbacks[3].init_args.evaluator.init_args.split = "train"
Expand Down
1 change: 0 additions & 1 deletion tests/config/sweep/sweep_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Vis4d Sweep Config Tests."""


import unittest

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/data/cbgs_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Class-balanced Grouping and Sampling for 3D Object Detection test."""

from tests.util import get_test_data
from vis4d.data.cbgs import CBGSDataset
from vis4d.data.datasets.nuscenes import NuScenes, nuscenes_class_map
Expand Down
1 change: 1 addition & 0 deletions tests/data/data_pipe_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test data pipelines."""

import os

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/bdd100k_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""BDD100K dataset testing class."""

import os
import unittest

Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/coco_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""COCO dataset testing class."""

import unittest

import torch
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/nuscenes_mono_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""NuScenes monocular dataset testing class."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/nuscenes_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""NuScenes dataset testing class."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/nuscenes_trajectory_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""NuScenes trajectory dataset tests."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/s3dis_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""S3DIS dataset testing class."""

import unittest

from tests.util import get_test_data
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/scalabel_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for scalabel dataset."""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/shift_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""S3DIS dataset testing class."""

import unittest

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/data/datasets/torchvision_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for Torchvision dataset wrapper."""

import os
import shutil
import tempfile
Expand Down
1 change: 1 addition & 0 deletions tests/data/io/backend_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for data backends."""

import os
import shutil
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/data/io/to_hdf5_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for hdf5 dataset conversion."""

import os
import unittest

Expand Down
1 change: 1 addition & 0 deletions tests/data/iterable_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Iterable datasets tests."""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/data/loader_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test loader components."""

import unittest

import torch
Expand Down
1 change: 1 addition & 0 deletions tests/data/reference_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for reference view sampling."""

import unittest

from vis4d.data.reference import SequentialViewSampler, UniformViewSampler
Expand Down
1 change: 1 addition & 0 deletions tests/data/resample_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Resample index to recover the original dataset length test."""

from tests.util import get_test_data
from vis4d.data.datasets.nuscenes import NuScenes
from vis4d.data.resample import ResampleDataset
Expand Down
1 change: 1 addition & 0 deletions tests/data/transforms/autoaugment_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for auto-augment transform."""

import numpy as np

from vis4d.common.util import set_random_seed
Expand Down
1 change: 1 addition & 0 deletions tests/data/transforms/random_erasing_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for normalize transform."""

import numpy as np

from vis4d.data.transforms.random_erasing import RandomErasing
Expand Down
1 change: 1 addition & 0 deletions tests/data/transforms/to_tensor_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ToTensor transform."""

import numpy as np
import torch

Expand Down
1 change: 1 addition & 0 deletions tests/engine/callbacks/checkpoint_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for checkpoint callback."""

import shutil
import tempfile
import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/engine/callbacks/ema_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for EMA callback."""

import unittest

import torch
Expand Down
1 change: 1 addition & 0 deletions tests/engine/callbacks/evaluator_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for evaluator callback."""

import shutil
import tempfile
import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/engine/callbacks/logging_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for logging callback."""

import unittest

from tests.util import MOCKLOSS, MockModel
Expand Down
1 change: 1 addition & 0 deletions tests/engine/callbacks/visualizer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for visualizer callback."""

import shutil
import tempfile
import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/engine/connectors_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test data connector."""

import torch

from vis4d.engine.connectors import MultiSensorDataConnector, data_key
Expand Down
1 change: 1 addition & 0 deletions tests/engine/optim/optimizer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for optimizer."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/engine/optim/scheduler_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for learning rate schedulers."""

import copy
import unittest

Expand Down
1 change: 1 addition & 0 deletions tests/engine/trainer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Engine trainer tests."""

from __future__ import annotations

import shutil
Expand Down
1 change: 1 addition & 0 deletions tests/engine/util_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test engine util."""

from collections import namedtuple
from dataclasses import dataclass

Expand Down
1 change: 1 addition & 0 deletions tests/eval/bdd100k/seg_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for BDD100K segmentation evaluator."""

from __future__ import annotations

import os.path as osp
Expand Down
1 change: 1 addition & 0 deletions tests/eval/bdd100k/track_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for BDD100K tracking evaluator."""

from __future__ import annotations

import os.path as osp
Expand Down
1 change: 1 addition & 0 deletions tests/eval/coco/detect_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for COCO evaluator."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/common/binary_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Occupancy test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/common/depth_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Depth eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/common/flow_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Depth eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/common/seg_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Seg eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/kitti/depth_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""KITTI Depth Evaluation test."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/nuscenes/detect3d_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for NuScenes 3D detection evaluator."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/nuscenes/track3d_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for NuScenes 3D tracking evaluator."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/scalabel/detect_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for BDD100K detection evaluator."""

from __future__ import annotations

import os.path as osp
Expand Down
1 change: 1 addition & 0 deletions tests/eval/scalabel/track_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testcases for BDD100K tracking evaluator."""

from __future__ import annotations

import os.path as osp
Expand Down
1 change: 1 addition & 0 deletions tests/eval/shift/depth_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SHIFT eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/shift/detect_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SHIFT eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/shift/flow_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SHIFT eval test cases."""

from __future__ import annotations

import unittest
Expand Down
1 change: 1 addition & 0 deletions tests/eval/shift/multitask_writer_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SHIFT eval test cases."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions tests/eval/shift/seg_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SHIFT eval test cases."""

from __future__ import annotations

import unittest
Expand Down
Loading

0 comments on commit b25086f

Please sign in to comment.