-
Notifications
You must be signed in to change notification settings - Fork 13
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
Comments
Hello, Thank you for making this package open-source! I have encountered the same issue described by @JaySenthil with the My hypothesis is that the problem lies with the spine segmentation. In my case, the subject has degenerative changes at T9-T11, which causes the spine segmentation to fail. As shown in the mask below from the spine segmentation nifti, one vertebra is segmented into two classes, which likely leads to the failure in the subsequent step. Additionally, I have three different measurements from the same subject taken in three different years, and the pipeline fails in all cases following a similar spine segmentation issue. I hope this information helps in resolving the issue. If I can run any tests on the images to assist with debugging, I’d be happy to do so. Best regards
|
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.
The text was updated successfully, but these errors were encountered: