Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix apis/train.py for build_dataloader #289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions mmgen/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def train_model(model,
k: v
for k, v in cfg.data.items() if k not in [
'train', 'val', 'test', 'train_dataloader', 'val_dataloader',
'test_dataloader'
'test_dataloader', 'val_samples_per_gpu', 'val_workers_per_gpu'
]
})

Expand Down Expand Up @@ -179,8 +179,13 @@ def train_model(model,
**loader_cfg, 'shuffle': False,
**cfg.data.get('val_data_loader', {})
}
val_dataloader = build_dataloader(
val_dataset, dist=distributed, **val_loader_cfg)
val_loader_cfg.update({
'samples_per_gpu':
cfg.data.get('val_samples_per_gpu', cfg.data.samples_per_gpu),
'workers_per_gpu':
cfg.data.get('val_workers_per_gpu', cfg.data.workers_per_gpu)
})
val_dataloader = build_dataloader(val_dataset, **val_loader_cfg)
eval_cfg = deepcopy(cfg.get('evaluation'))
priority = eval_cfg.pop('priority', 'LOW')
eval_cfg.update(dict(dist=distributed, dataloader=val_dataloader))
Expand Down