Skip to content

Commit

Permalink
Added cache_size parameter to the post-processing training config
Browse files Browse the repository at this point in the history
Added `cache_size` parameter to the post-processing training config
  • Loading branch information
AlekseySh authored Jun 17, 2024
1 parent 0e3776f commit 8bf558a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oml/lightning/pipelines/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_retrieval_loaders(cfg: TCfg) -> Tuple[DataLoader, DataLoader, ILabeledDa
transforms_train=get_transforms_by_cfg(cfg["transforms_train"]),
transforms_val=get_transforms_by_cfg(cfg["transforms_val"]),
dataframe_name=cfg["dataframe_name"],
cache_size=cfg["cache_size"],
cache_size=cfg.get("cache_size", 0),
verbose=cfg.get("show_dataset_warnings", True),
)

Expand Down
2 changes: 2 additions & 0 deletions oml/lightning/pipelines/train_postprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ def get_loaders_with_embeddings(

train_dataset = ImageLabeledDataset(
dataset_root=cfg["dataset_root"],
cache_size=cfg.get("cache_size", 0),
df=train_extraction.df,
transform=get_transforms_by_cfg(cfg["transforms_train"]),
extra_data={EMBEDDINGS_KEY: emb_train},
)

valid_dataset = ImageQueryGalleryLabeledDataset(
dataset_root=cfg["dataset_root"],
cache_size=cfg.get("cache_size", 0),
df=val_extraction.df,
transform=transforms_extraction,
extra_data={EMBEDDINGS_KEY: emb_val},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dataframe_name: df.csv
logs_folder: ${now:%Y-%m-%d_%H-%M-%S}_${postfix}

num_workers: 20
cache_size: 0
max_epochs: 1000
valid_period: 10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dataframe_name: df_with_category.csv
logs_root: logs

num_workers: 0
cache_size: 50
max_epochs: 2
valid_period: 1

Expand Down

0 comments on commit 8bf558a

Please sign in to comment.