Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion monai/transforms/signal/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
"""

import warnings
from typing import Any, Optional, Sequence

import numpy as np
Expand All @@ -27,7 +28,9 @@

shift, has_shift = optional_import("scipy.ndimage.interpolation", name="shift")
iirnotch, has_iirnotch = optional_import("scipy.signal", name="iirnotch")
filtfilt, has_filtfilt = optional_import("torchaudio.functional", name="filtfilt")
with warnings.catch_warnings():
warnings.simplefilter("ignore", UserWarning) # project-monai/monai#5204
filtfilt, has_filtfilt = optional_import("torchaudio.functional", name="filtfilt")
central_frequency, has_central_frequency = optional_import("pywt", name="central_frequency")
cwt, has_cwt = optional_import("pywt", name="cwt")

Expand Down
10 changes: 5 additions & 5 deletions monai/utils/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ def load_submodules(basemod, load_all: bool = True, exclude_pattern: str = "(.*[
except OptionalImportError:
pass # could not import the optional deps., they are ignored
except ImportError as e:
raise ImportError(
"Multiple versions of MONAI may have been installed,\n"
"please uninstall existing packages (both monai and monai-weekly) and install a version again.\n"
"See also: https://docs.monai.io/en/stable/installation.html\n"
) from e
msg = (
"\nMultiple versions of MONAI may have been installed?\n"
Comment thread
wyli marked this conversation as resolved.
"Please see the installation guide: https://docs.monai.io/en/stable/installation.html\n"
) # issue project-monai/monai#5193
raise type(e)(f"{e}\n{msg}").with_traceback(e.__traceback__) from e # raise with modified message

return submodules, err_mod

Expand Down