From 96e887da4be2c13f5f58da3359a9ab891c44d050 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 16 Jan 2023 18:45:03 +0100 Subject: If valid set size is 0, re-use one image from train set --- data/csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/csv.py b/data/csv.py index 6857b6f..85b98f8 100644 --- a/data/csv.py +++ b/data/csv.py @@ -282,7 +282,7 @@ class VlpnDataModule(): collate_fn_ = partial(collate_fn, self.dtype, self.tokenizer, self.num_class_images != 0) if valid_set_size == 0: - data_train, data_val = items, [] + data_train, data_val = items, items[:1] else: data_train, data_val = random_split(items, [train_set_size, valid_set_size], generator=generator) -- cgit v1.2.3-70-g09d2