From f23fd5184b8ba4ec04506495f4a61726e50756f7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 3 Oct 2022 17:38:44 +0200 Subject: Small perf improvements --- data/dreambooth/csv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'data/dreambooth') diff --git a/data/dreambooth/csv.py b/data/dreambooth/csv.py index 71aa1eb..c0b0067 100644 --- a/data/dreambooth/csv.py +++ b/data/dreambooth/csv.py @@ -70,8 +70,9 @@ class CSVDataModule(pl.LightningDataModule): size=self.size, interpolation=self.interpolation, identifier=self.identifier, center_crop=self.center_crop, batch_size=self.batch_size) self.train_dataloader_ = DataLoader(train_dataset, batch_size=self.batch_size, - shuffle=True, collate_fn=self.collate_fn) - self.val_dataloader_ = DataLoader(val_dataset, batch_size=self.batch_size, collate_fn=self.collate_fn) + shuffle=True, pin_memory=True, collate_fn=self.collate_fn) + self.val_dataloader_ = DataLoader(val_dataset, batch_size=self.batch_size, + pin_memory=True, collate_fn=self.collate_fn) def train_dataloader(self): return self.train_dataloader_ -- cgit v1.2.3-70-g09d2