Skip to content

Commit

Permalink
Update monai/data/image_reader.py
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Kerfoot <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
  • Loading branch information
yiheng-wang-nv and ericspod authored Dec 16, 2024
1 parent 1b12a39 commit b70a5f5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions monai/data/image_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,9 @@ def __init__(
self.channel_dim = float("nan") if channel_dim == "no_channel" else channel_dim
self.as_closest_canonical = as_closest_canonical
self.squeeze_non_spatial_dims = squeeze_non_spatial_dims
if to_gpu is True:
if not has_cp:
warnings.warn("CuPy is not installed, fall back to use cpu load.")
to_gpu = False
if not has_kvikio:
warnings.warn("Kvikio is not installed, fall back to use cpu load.")
to_gpu = False
if to_gpu and (not has_cp or not has_kvikio):
warnings.warn("NibabelReader: CuPy and/or Kvikio not installed for GPU loading, falling back to CPU loading.")
to_gpu = False

self.to_gpu = to_gpu
self.kwargs = kwargs
Expand Down

0 comments on commit b70a5f5

Please sign in to comment.