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
6 changes: 5 additions & 1 deletion monai/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ def _cachecheck(self, item_transformed):
raise e

_item_transformed = self._pre_transform(deepcopy(item_transformed)) # keep the original hashed
if hashfile is not None:
if hashfile is None:
return _item_transformed
try:
# NOTE: Writing to a temporary directory and then using a nearly atomic rename operation
# to make the cache more robust to manual killing of parent process
# which may leave partially written cache files in an incomplete state
Expand All @@ -354,6 +356,8 @@ def _cachecheck(self, item_transformed):
shutil.move(temp_hash_file, hashfile)
except FileExistsError:
pass
except PermissionError: # project-monai/monai issue #3613
pass
return _item_transformed

def _transform(self, index: int):
Expand Down