Skip to content

Commit

Permalink
[Develop] Move drop_last into MPA (#1357)
Browse files Browse the repository at this point in the history
* Move drop_last into MPA
  • Loading branch information
JihwanEom authored Nov 11, 2022
1 parent 3168670 commit 214401d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,17 +368,9 @@ def patch_color_conversion(pipeline):
elif self._hierarchical:
cfg.type = "MPAHierarchicalClsDataset"
cfg.hierarchical_info = self._hierarchical_info
if subset == "train":
cfg.drop_last = True # For stable hierarchical information indexing
else:
cfg.type = "MPAClsDataset"

# In train dataset, when sample size is smaller than batch size
if subset == "train" and self._data_cfg:
train_data_cfg = Stage.get_data_cfg(self._data_cfg, "train")
if len(train_data_cfg.get("ote_dataset", [])) < self._recipe_cfg.data.get("samples_per_gpu", 2):
cfg.drop_last = False

cfg.domain = domain
cfg.ote_dataset = None
cfg.labels = None
Expand Down

0 comments on commit 214401d

Please sign in to comment.