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

train_retriever: support new version of mmcv #95

Open
wants to merge 1 commit 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: 6 additions & 5 deletions mmfashion/apis/train_retriever.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import division

from collections import OrderedDict

import torch
Expand Down Expand Up @@ -49,17 +50,17 @@ def train_retriever(model,

# start training predictor
if distributed: # to do
_dist_train(model, dataset, cfg, validate=validate)
_dist_train(model, dataset, cfg, validate=validate, logger=logger)
else:
_non_dist_train(model, dataset, cfg, validate=validate)
_non_dist_train(model, dataset, cfg, validate=validate, logger=logger)


def _dist_train(model, dataset, cfg, validate=False):
def _dist_train(model, dataset, cfg, validate=False, logger=None):
""" not implemented yet """
raise NotImplementedError


def _non_dist_train(model, dataset, cfg, validate=False):
def _non_dist_train(model, dataset, cfg, validate=False, logger=None):
# prepare data loaders
data_loaders = [
build_dataloader(
Expand All @@ -76,7 +77,7 @@ def _non_dist_train(model, dataset, cfg, validate=False):

optimizer = build_optimizer(model, cfg.optimizer)
runner = Runner(model, batch_processor, optimizer, cfg.work_dir,
cfg.log_level)
logger)

runner.register_training_hooks(cfg.lr_config, cfg.optimizer_config,
cfg.checkpoint_config, cfg.log_config)
Expand Down