Skip to content

Commit

Permalink
Hit a recursion limit bug, increase
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathijs de Boer committed Dec 1, 2023
1 parent 979a716 commit 1d6983c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nnunetv2/model_sharing/onnx_export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import sys
from os.path import isdir
from pathlib import Path
from typing import Tuple, Union
Expand Down Expand Up @@ -35,6 +36,9 @@ def export_onnx_model(
if not output_names:
output_names = (f"{checkpoint[:-4]}.onnx" for checkpoint in save_checkpoints)

original_recursion_limit = sys.getrecursionlimit()
sys.setrecursionlimit(10_000)

dataset_name = maybe_convert_to_dataset_name(dataset_name_or_id)
for c in configurations:
print(f"Configuration {c}")
Expand Down Expand Up @@ -150,3 +154,5 @@ def export_onnx_model(
f,
indent=4,
)

sys.setrecursionlimit(original_recursion_limit)

0 comments on commit 1d6983c

Please sign in to comment.