From dab2ec79229c3800253a209304dbb1e7ac1d1219 Mon Sep 17 00:00:00 2001 From: Bartosz Michalak Date: Tue, 6 Feb 2018 12:10:37 +0100 Subject: [PATCH] Add empty close method as default for Dataset Datasets implemented in the future might want to do some cleanup when they are destroyed (one example is OldH5Dataset, which closes the underlying h5 file). To avoid AttributeError in train.py, all datasets now are closed at the end of training. This should not break the already weird behaviour of crashing at the end of training for the already existing saved datasets. --- dataset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dataset.py b/dataset.py index 99ad43e..866638e 100644 --- a/dataset.py +++ b/dataset.py @@ -66,6 +66,9 @@ def __getitem__(self, item): # print(data[0]) return torch.from_numpy(datapoint.astype('float32')) + def close(self): + pass + class OldH5Dataset(DepthDataset):