-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rectangle_perimeter
with NaN params causes fatal memory leak
#7114
Comments
Hmm, I can't reproduce the RAM bombing on my machine. Instead I get skimage/draw/draw.py:959: RuntimeWarning: invalid value encountered in cast
top_left = np.round(top_left).astype(int)
skimage/draw/draw.py:960: RuntimeWarning: invalid value encountered in cast
bottom_right = np.round(bottom_right).astype(int)
skimage/draw/draw.py:271: RuntimeWarning: invalid value encountered in cast
r = np.round(r).astype(int)
skimage/draw/draw.py:272: RuntimeWarning: invalid value encountered in cast
c = np.round(c).astype(int) and this output (array([-9223372036854775808, -9223372036854775808, -9223372036854775808,
-9223372036854775808]),
array([-9223372036854775808, -9223372036854775808, -9223372036854775808,
-9223372036854775808])) I am a bit surprised because from a casual look there isn't much that might be platform specific to the involved code. Maybe scikit-image/skimage/draw/draw.py Lines 959 to 960 in a45f2da
is behaving different for you? Could you check the output of np.round((np.nan, np.nan)).astype(int) on your machine? In any case, we should probably introduce a guard that checks for NaN, which in this case shouldn't have any noticeable performance implications. |
Oh, and thanks for the report @eyaler! |
rectangle_perimeter
with NaN params causes fatal memory leak
then you have in https://github.com/scikit-image/scikit-image/blob/v0.21.0/skimage/draw/draw.py#L929 so let do: that's one big rectangle! |
Yes, this doesn't seem to happen on my hardware because Are you interested in making a PR that adds a check for NaN's to address this issue? A simple |
Re my comment above, I actually forgot that I already made a PR for this #7115. 🙈 😄 |
Hello scikit-image core devs! There hasn't been any activity on this issue for more than 180 days. I have marked it as "dormant" to make it easy to find. |
Description:
Following code raises RAM usage to 100% within a few seconds and hangs the (64GB) machine. I had the NaN's due to an invalid bounding box calculation.
Way to reproduce:
Version information:
The text was updated successfully, but these errors were encountered: