Skip to content

Commit

Permalink
revert stride_shape override
Browse files Browse the repository at this point in the history
  • Loading branch information
wolny committed Apr 17, 2024
1 parent 22914f3 commit af3ad08
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pytorch3dunet/datasets/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,10 @@ def __init__(self, file_path, phase, slice_builder_config, transformer_config, r
# compare patch and stride configuration
patch_shape = slice_builder_config.get('patch_shape')
stride_shape = slice_builder_config.get('stride_shape')
if patch_shape != stride_shape:
logger.warning(f'Patch shape and stride shape should be equal for optimal prediction performance,'
f'but found patch_shape: {patch_shape} and stride_shape: {stride_shape} in the config!'
f'Overriding stride_shape to match patch_shape!')
slice_builder_config['stride_shape'] = patch_shape
if sum(self.halo_shape) != 0 and patch_shape != stride_shape:
logger.warning(f'Found non-zero halo shape {self.halo_shape}. '
f'In this case: patch shape and stride shape should be equal for optimal prediction '
f'performance, but found patch_shape: {patch_shape} and stride_shape: {stride_shape}!')

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

0 comments on commit af3ad08

Please sign in to comment.