Migrate workflow=[('train', 1), ('val', 1)] option to mmengine #1444
Unanswered
EvgeniyBerdyugin
asked this question in
Q&A
Replies: 1 comment
-
Hi, you can configure it in mmengine via from torch.optim import SGD
from mmengine.runner import Runner
runner = Runner(
# the model used for training and validation.
# Needs to meet specific interface requirements
model=MMResNet50(),
# working directory which saves training logs and weight files
work_dir='./work_dir',
# train dataloader needs to meet the PyTorch data loader protocol
train_dataloader=train_dataloader,
# optimize wrapper for optimization with additional features like
# AMP, gradtient accumulation, etc
optim_wrapper=dict(optimizer=dict(type=SGD, lr=0.001, momentum=0.9)),
# trainging coinfs for specifying training epoches, verification intervals, etc
train_cfg=dict(by_epoch=True, max_epochs=5, val_interval=1),
# validation dataloaer also needs to meet the PyTorch data loader protocol
val_dataloader=val_dataloader,
# validation configs for specifying additional parameters required for validation
val_cfg=dict(),
# validation evaluator. The default one is used here
val_evaluator=dict(type=Accuracy),
)
runner.train() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you very much to the developers for your work. I looked through a lot of documentation, but did not find any analogue of the workflow=[('train', 1), ('val', 1)] option on the latest version of mmengine. I would like that during training, losses would be shown on both the training and test datasets. I put this option in the config or runner, but nothing changes.
Beta Was this translation helpful? Give feedback.
All reactions