Commit 0ea6bc1b authored by Yanghan Wang's avatar Yanghan Wang Committed by Facebook GitHub Bot
Browse files

add configure_dataset_creation for lightning

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/423

The `DefaultTask` has forked the implementation of some runner methods from `Detectron2GoRunner`, which is not necessary since there should be no differences. This might cause issue that we update the one from `Detectron2GoRunner` but forgot about `DefaultTask`.

Reviewed By: chihyaoma

Differential Revision: D41350485

fbshipit-source-id: 38a1764a7cc77dc13939ac7d59f35584bf9dab9b
parent 9ec4f2bf
......@@ -407,9 +407,9 @@ class DefaultTask(pl.LightningModule):
@classmethod
def build_detection_train_loader(cls, cfg, *args, mapper=None, **kwargs):
mapper = mapper or cls.get_mapper(cfg, is_train=True)
data_loader = build_d2go_train_loader(cfg, mapper)
return cls._attach_visualizer_to_data_loader(cfg, data_loader)
return Detectron2GoRunner.build_detection_train_loader(
cfg, *args, mapper=mapper, **kwargs
)
@staticmethod
def build_detection_test_loader(cfg, dataset_name, mapper=None):
......@@ -417,12 +417,7 @@ class DefaultTask(pl.LightningModule):
@classmethod
def _attach_visualizer_to_data_loader(cls, cfg, data_loader):
if comm.is_main_process():
data_loader_type = cls.get_data_loader_vis_wrapper()
if data_loader_type is not None:
tbx_writer = Detectron2GoRunner.get_tbx_writer(cfg)
data_loader = data_loader_type(cfg, tbx_writer, data_loader)
return data_loader
return Detectron2GoRunner._attach_visualizer_to_data_loader(cfg, data_loader)
# ---------------------------------------------------------------------------
# Hooks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment