You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running the predict method of CytoplasmSegmentation, an error is thrown with the message ValueError: zero-size array to reduction operation maximum which has no identity.
Upon investigation, the issue seems to be related to the _untile_output function in the Application class. Specifically, when the _process function is called to remove padding from the image, it results in a zero-dimensional array if the padding is zero.
In Python, using negative zero indexing (like a[0:-0]) does not behave as expected. Instead of returning the whole array, it returns an empty array.
Steps to Reproduce
Run the predict method of CytoplasmSegmentation with an image where y-padding is zero i.e. width of 512 for the default model.
Expected Behavior
The _process function should handle the case where padding is zero, and return the original image in such cases, rather than an empty array. One solution is:
I just ran into this same bug when trying to use the NuclearSegmentation application to predict on a 216x256 image which is smaller than the training size for the model.
@rossbar I tested a redeploy of the kiosk with deepcell 0.12.5. Of course, our current sample data for nuclear segmentation is 256x256 so this bug pops up right away if anyone uses the exiting sample data. I can swap out the sample data for something bigger, but if we can resolve this issue before the tracking preprint comes out that would be best.
Bug Report
Description
While running the
predict
method ofCytoplasmSegmentation
, an error is thrown with the messageValueError: zero-size array to reduction operation maximum which has no identity
.Upon investigation, the issue seems to be related to the
_untile_output
function in theApplication
class. Specifically, when the_process
function is called to remove padding from the image, it results in a zero-dimensional array if the padding is zero.Here is the problematic code (link):
In Python, using negative zero indexing (like
a[0:-0]
) does not behave as expected. Instead of returning the whole array, it returns an empty array.Steps to Reproduce
predict
method ofCytoplasmSegmentation
with an image where y-padding is zero i.e. width of 512 for the default model.Expected Behavior
The
_process
function should handle the case where padding is zero, and return the original image in such cases, rather than an empty array. One solution is:Actual Behavior
The function returns an empty array if padding is zero, leading to a
ValueError
in later processing steps.Please let me know if you have any questions or if you need more information.
The text was updated successfully, but these errors were encountered: