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

[Develop] Move drop_last into MPA #1357

Merged
merged 3 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
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