Skip to content

Commit 14c1197

Browse files
Gracefully die when attempting to run Brats dataset with torch>=2.2
1 parent d26d848 commit 14c1197

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/cv/brats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def __init__(self, dataset_dir_path=None):
5050
self.__input_details = list()
5151

5252
if not self.__preprocessed_dir_path.is_dir():
53+
import pkg_resources
54+
from packaging import version
55+
if version.parse(pkg_resources.get_distribution("torch").version) >= version.parse("2.2"):
56+
utils.print_goodbye_message_and_die("nnunet library requires torch<2.2")
5357
self.__preprocess()
5458

5559
with open(os.path.join(Path(self.__preprocessed_dir_path, "preprocessed_files.pkl")), "rb") as f:

0 commit comments

Comments
 (0)