Skip to content

Commit

Permalink
don't register the DummyDataset
Browse files Browse the repository at this point in the history
  • Loading branch information
HIT-cwh committed Oct 20, 2022
1 parent 12f346d commit 290fec3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from mmengine.logging import MMLogger
from mmengine.model import BaseModel, ExponentialMovingAverage
from mmengine.optim import OptimWrapper
from mmengine.registry import DATASETS
from mmengine.runner import Runner
from torch.utils.data import Dataset

Expand Down Expand Up @@ -43,7 +42,6 @@ def forward(self, inputs, data_sample, mode='tensor'):
return outputs


@DATASETS.register_module()
class DummyDataset(Dataset):
METAINFO = dict() # type: ignore
data = torch.randn(12, 2)
Expand Down Expand Up @@ -133,12 +131,12 @@ def test_ema_hook(self):
runner = Runner(
model=model,
train_dataloader=dict(
dataset=dict(type='DummyDataset'),
dataset=DummyDataset(),
sampler=dict(type='DefaultSampler', shuffle=True),
batch_size=3,
num_workers=0),
val_dataloader=dict(
dataset=dict(type='DummyDataset'),
dataset=DummyDataset(),
sampler=dict(type='DefaultSampler', shuffle=False),
batch_size=3,
num_workers=0),
Expand Down
6 changes: 2 additions & 4 deletions tests/test_core/test_recorders/test_func_inputs_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from mmengine.logging import MMLogger
from mmengine.model import BaseModel, ExponentialMovingAverage
from mmengine.optim import OptimWrapper
from mmengine.registry import DATASETS
from mmengine.runner import Runner
from torch.utils.data import Dataset

Expand Down Expand Up @@ -45,7 +44,6 @@ def forward(self, inputs, data_sample, mode='tensor'):
return outputs


@DATASETS.register_module()
class DummyDataset(Dataset):
METAINFO = dict() # type: ignore
data = torch.randn(12, 2)
Expand Down Expand Up @@ -108,12 +106,12 @@ def test_ema_hook(self):
runner = Runner(
model=model,
train_dataloader=dict(
dataset=dict(type='DummyDataset'),
dataset=DummyDataset(),
sampler=dict(type='DefaultSampler', shuffle=True),
batch_size=3,
num_workers=0),
val_dataloader=dict(
dataset=dict(type='DummyDataset'),
dataset=DummyDataset(),
sampler=dict(type='DefaultSampler', shuffle=False),
batch_size=3,
num_workers=0),
Expand Down

0 comments on commit 290fec3

Please sign in to comment.