Skip to content

Commit bdf00dc

Browse files
committed
revert stride_shape override
1 parent f7737e7 commit bdf00dc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pytorch3dunet/datasets/hdf5.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ def __init__(self, file_path, phase, slice_builder_config, transformer_config, r
8787
# compare patch and stride configuration
8888
patch_shape = slice_builder_config.get('patch_shape')
8989
stride_shape = slice_builder_config.get('stride_shape')
90-
if patch_shape != stride_shape:
91-
logger.warning(f'Patch shape and stride shape should be equal for optimal prediction performance,'
92-
f'but found patch_shape: {patch_shape} and stride_shape: {stride_shape} in the config!'
93-
f'Overriding stride_shape to match patch_shape!')
94-
slice_builder_config['stride_shape'] = patch_shape
90+
if sum(self.halo_shape) != 0 and patch_shape != stride_shape:
91+
logger.warning(f'Found non-zero halo shape {self.halo_shape}. '
92+
f'In this case: patch shape and stride shape should be equal for optimal prediction '
93+
f'performance, but found patch_shape: {patch_shape} and stride_shape: {stride_shape}!')
9594

9695
with h5py.File(file_path, 'r') as f:
9796
raw = f[raw_internal_path]

0 commit comments

Comments
 (0)