Skip to content
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

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

Open
JaySenthil opened this issue Oct 5, 2024 · 0 comments

Comments

@JaySenthil
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant