Skip to content

Commit

Permalink
fix: allow more runtime errors in find_batch_size()
Browse files Browse the repository at this point in the history
This attempts to fix #358.
  • Loading branch information
qin-yu committed Nov 18, 2024
1 parent 36e9445 commit d8ffe1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plantseg/functionals/prediction/utils/size_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def find_batch_size(
if "out of memory" in str(e):
batch_size //= 2
break
elif "less than INT_MAX elements" in str(e):
logger.warning(f"Encountered '{e}', unexpected but continuing with reduced batch size.")
batch_size //= 2
break

Check warning on line 176 in plantseg/functionals/prediction/utils/size_finder.py

View check run for this annotation

Codecov / codecov/patch

plantseg/functionals/prediction/utils/size_finder.py#L173-L176

Added lines #L173 - L176 were not covered by tests
else:
raise
finally:
Expand Down

0 comments on commit d8ffe1d

Please sign in to comment.