Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions monai/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,9 @@ class SmartCacheDataset(Randomizable, CacheDataset):
This replacement will not work if setting the `multiprocessing_context` of DataLoader to `spawn`
or on windows(the default multiprocessing method is `spawn`) and setting `num_workers` greater than 0.

If using MONAI workflows, please add `SmartCacheHandler` to the handler list of trainer,
otherwise, please make sure to call `start()`, `update_cache()`, `shutdown()` during training.

Args:
data: input data to load and transform to generate dataset for model.
transform: transforms to execute operations on input data.
Expand Down Expand Up @@ -800,18 +803,6 @@ def __len__(self):
"""
return self.cache_num

def __getitem__(self, index):
"""
Raise exception if didn't call the expected APIs in SmartCacheDataset.

"""
if not self.is_started():
raise RuntimeError(
"if using MONAI workflows, please add `SmartCacheHandler` to the handler list of trainer,"
"otherwise, please make sure to call `start()`, `update_cache()`, `shutdown()` during training."
)
return super().__getitem__(index)


class ZipDataset(Dataset):
"""
Expand Down