small fixes (#581)

* small fix

* oom error

* created model wrapper; make DDP working again; todo need to check if it works with viewer

* working with multigpu now
This commit is contained in:
evonneng authored and GitHub committed 2022-10-02 13:54:13 -07:00
1 parent 3489e992b0
commit 50d9aa1341
7 files changed
+38 -23

No files matched your search

+4 -2
View File
@@ -21,6 +21,7 @@ from abc import abstractmethod
from typing import Dict, Optional, Tuple, Union
import torch
from rich.progress import track
from torch.utils.data import Dataset, default_collate
from torch.utils.data.dataloader import DataLoader
@@ -69,8 +70,9 @@ class CacheDataloader(DataLoader):
def _get_batch_list(self):
"""Returns a list of batches from the dataset attribute."""
indices = random.sample(range(len(self.dataset)), k=self.num_images_to_sample_from)
batch_list = [self.dataset.__getitem__(idx) for idx in indices]
batch_list = []
for idx in track(indices, description="Loading data batch"):
batch_list.append(self.dataset.__getitem__(idx))
return batch_list
def _get_collated_batch(self):