diff --git a/direct/data/datasets.py b/direct/data/datasets.py index 1939deb2..3489e27f 100644 --- a/direct/data/datasets.py +++ b/direct/data/datasets.py @@ -69,7 +69,9 @@ def __getitem__(self, idx: int) -> Dict[str, Any]: # Some images have strange behavior. image_shape = sample["kspace"].shape - if image_shape[-1] < sample["reconstruction_size"][-2]: # reconstruction size is (x, y, z) + if ( + image_shape[-1] < sample["reconstruction_size"][-2] + ): # reconstruction size is (x, y, z) warnings.warn( f"Encountered {sample['filename']} with header reconstruction size {sample['reconstruction_size']}, " f" yet matrix size is {image_shape}, this is a known issue in the FastMRI dataset." diff --git a/direct/nn/rim/rim_engine.py b/direct/nn/rim/rim_engine.py index 622bc240..36448bbe 100644 --- a/direct/nn/rim/rim_engine.py +++ b/direct/nn/rim/rim_engine.py @@ -197,8 +197,10 @@ def evaluate( data = AddNames()(data) filenames = data.pop("filename") if len(set(filenames)) != 1: - raise ValueError(f"Expected a batch during validation to only contain filenames of one case. " - f"Got {set(filenames)}.") + raise ValueError( + f"Expected a batch during validation to only contain filenames of one case. " + f"Got {set(filenames)}." + ) slice_nos = data.pop("slice_no") scaling_factors = data.pop("scaling_factor")