When trying to start a new Boundary-based Segmentation with Multicut project, I get the following error:
"zero size array to reduction operation maximum which has no identity "
This is how I got the error:
Start new multicut workflow
Load one images, including probabilities and ground truth
Ran watershed
Changed some parameters and updated watershed (not sure if relevant)
That’s when I got the error.
this is the log:
INFO 2023-05-05 14:55:02,085 opWsdt 732 7160 blockwise watershed with 4 threads.
INFO 2023-05-05 14:55:02,327 opWsdt 732 7160 parallel ws took 0.238343 s
ERROR 2023-05-05 14:55:04,441 excepthooks 732 8276 Unhandled exception in thread: 'Worker #0'
ERROR 2023-05-05 14:55:04,441 excepthooks 732 16280 Unhandled exception in thread: 'Worker #3'
ERROR 2023-05-05 14:55:04,441 excepthooks 732 21392 Unhandled exception in thread: 'Worker #2'
ERROR 2023-05-05 14:55:04,441 excepthooks 732 7160 Unhandled exception in thread: 'Worker #1'
ERROR 2023-05-05 14:55:04,441 excepthooks 732 8276 Traceback (most recent call last):
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 360, in _execute
self._result = self.fn()
File "D:\ilastik-1.4.0\lib\site-packages\ilastik\applets\edgeTraining\edgeTrainingGui.py", line 370, in _impl
edge_probs = op.EdgeProbabilitiesDict.value
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 1015, in value
temp = self[:].wait()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 541, in wait
return self._wait(timeout)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 569, in _wait
self._wait_within_request(current_request)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 698, in _wait_within_request
raise_with_traceback(exc_value, exc_tb)
File "D:\ilastik-1.4.0\lib\site-packages\future\utils\__init__.py", line 446, in raise_with_traceback
raise exc.with_traceback(traceback)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 360, in _execute
self._result = self.fn()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 869, in __call__
result_op = self.operator.call_execute(self.slot.top_level_slot, self.slot.subindex, self.roi, destination)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operator.py", line 594, in call_execute
return self.execute(slot, subindex, roi, result, **kwargs)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operators\valueProviders.py", line 310, in execute
value = request.wait()[0]
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 541, in wait
return self._wait(timeout)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 569, in _wait
self._wait_within_request(current_request)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 654, in _wait_within_request
raise_with_traceback(exc_type(exc_value), exc_tb)
File "D:\ilastik-1.4.0\lib\site-packages\future\utils\__init__.py", line 446, in raise_with_traceback
raise exc.with_traceback(traceback)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 360, in _execute
self._result = self.fn()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 869, in __call__
result_op = self.operator.call_execute(self.slot.top_level_slot, self.slot.subindex, self.roi, destination)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operator.py", line 594, in call_execute
return self.execute(slot, subindex, roi, result, **kwargs)
File "D:\ilastik-1.4.0\lib\site-packages\ilastik\applets\edgeTraining\opEdgeTraining.py", line 465, in execute
rag = self.Rag.value
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 1015, in value
temp = self[:].wait()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 541, in wait
return self._wait(timeout)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 569, in _wait
self._wait_within_request(current_request)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 698, in _wait_within_request
raise_with_traceback(exc_value, exc_tb)
File "D:\ilastik-1.4.0\lib\site-packages\future\utils\__init__.py", line 446, in raise_with_traceback
raise exc.with_traceback(traceback)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 360, in _execute
self._result = self.fn()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 869, in __call__
result_op = self.operator.call_execute(self.slot.top_level_slot, self.slot.subindex, self.roi, destination)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operator.py", line 594, in call_execute
return self.execute(slot, subindex, roi, result, **kwargs)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operators\valueProviders.py", line 310, in execute
value = request.wait()[0]
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 541, in wait
return self._wait(timeout)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 569, in _wait
self._wait_within_request(current_request)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 698, in _wait_within_request
raise_with_traceback(exc_value, exc_tb)
File "D:\ilastik-1.4.0\lib\site-packages\future\utils\__init__.py", line 446, in raise_with_traceback
raise exc.with_traceback(traceback)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\request\request.py", line 360, in _execute
self._result = self.fn()
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\slot.py", line 869, in __call__
result_op = self.operator.call_execute(self.slot.top_level_slot, self.slot.subindex, self.roi, destination)
File "D:\ilastik-1.4.0\lib\site-packages\lazyflow\operator.py", line 594, in call_execute
return self.execute(slot, subindex, roi, result, **kwargs)
File "D:\ilastik-1.4.0\lib\site-packages\ilastik\applets\edgeTraining\opEdgeTraining.py", line 243, in execute
result[0] = ilastikrag.Rag(superpixels)
File "D:\ilastik-1.4.0\lib\site-packages\ilastikrag\rag.py", line 160, in __init__
self._init_sp_attributes()
File "D:\ilastik-1.4.0\lib\site-packages\ilastikrag\rag.py", line 384, in _init_sp_attributes
self._max_sp = self._sp_ids.max()
File "D:\ilastik-1.4.0\lib\site-packages\numpy\core\_methods.py", line 40, in _amax
return umr_maximum(a, axis, None, out, keepdims, initial, where)
ValueError: zero-size array to reduction operation maximum which has no identity
Hello @junli,
first of all, welcome to the image.sc community

Second, thank you very much for reporting this issue. I haven’t seen it before and would really like to be able to reproduce it on our side - so it would be great if you could share the image along with the corresponding probability maps (I’ll send you a DM with a instructions).
Cheers
Dominik
FYI I think I got the same error (zero-size array to reduction operation maximum which has no identity when applying a Multicut project to a particular image). I noticed it occurred on an image where very few pixels were predicted to be Boundary so it might be related to that. Happy to attach the project/image if useful.
Hello @tathey1,
first of all, welcome to the image.sc community

And second - thank you for the hint! I could reproduce the issue with your information.
xref: Multicut: ValueError in watershed stage with probability map that is all foreground · Issue #2117 · ilastik/ilastik · GitHub