Skip to content

ValueError: zero-size array to reduction operation minimum which has no identity #135

@JaySenthil

Description

@JaySenthil

Hello,

When I run the inference pipeline for spine_muscle_adipose_tissue, I get the following errors for some of my datasets. I believe its because the posterior_anterior_line array is all zeros, which causes np.where to return an empty array, and then np.min to return the error seen below.

Traceback (most recent call last):
File "/sfs/qumulo/qhome//Comp2Comp/comp2comp/utils/process.py", line 131, in process_3d
pipeline(output_dir=output_dir, model_dir=model_dir)
File "/sfs/qumulo/qhome/
/Comp2Comp/comp2comp/inference_pipeline.py", line 73, in call
output = inference_class(inference_pipeline=self, output)
File "/sfs/qumulo/qhome/
/Comp2Comp/comp2comp/inference_pipeline.py", line 69, in call
output = inference_class(
File "/sfs/qumulo/qhome/
/Comp2Comp/comp2comp/spine/spine.py", line 314, in call
spine_utils.compute_rois(
File "/sfs/qumulo/qhome/
/Comp2Comp/comp2comp/spine/spine_utils.py", line 378, in compute_rois
roi, mask_2d = roi_from_mask(
File "/sfs/qumulo/qhome/
/Comp2Comp/comp2comp/spine/spine_utils.py", line 247, in roi_from_mask
np.min(np.where(posterior_anterior_line == 1))
File "<array_function internals>", line 180, in amin
File "/home/
/.conda/envs/c2c/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2918, in amin
return _wrapreduction(a, np.minimum, 'min', axis, None, out,
File "/home/
**/.conda/envs/c2c/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

I'm not sure how to fix the error. Please let me know. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions