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

Fix/missing return statement #118

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

shota-0129
Copy link
Contributor

Overview

This PR addresses the issue of a missing return statement in the function.

Changes

Added a return statement to the load_config() function

Reason for the Fix

It was discovered that a function was missing a return statement, leading to unexpected behavior. This PR adds the missing return statement to ensure the function operates correctly.

@shota-0129 shota-0129 marked this pull request as draft July 12, 2024 05:47
@shota-0129 shota-0129 marked this pull request as ready for review July 12, 2024 05:49
@wolny
Copy link
Owner

wolny commented Jul 30, 2024

Hi @shota-0129, thanks for the fix!

@shota-0129
Copy link
Contributor Author

shota-0129 commented Jul 30, 2024

@wolny
The AttributeError: 'csr_matrix' object has no attribute 'A' is occurring in the def _iou_matrix(gt, seg) function in pytorch3dunet\unet3d\seg_metrics.py, specifically on the line n_inter = contingency_table(gt, seg).A.
Referring to https://scikit-image.org/docs/stable/api/skimage.metrics.html#skimage.metrics.contingency_table, the return value is a scipy.sparse.csr_matrix, which doesn't have an 'A' attribute.
To resolve this, I substituted it with toarray().
This ended up being in the same PR, but is that okay?

@shota-0129 shota-0129 requested a review from wolny July 30, 2024 11:35
@wolny wolny merged commit 5917023 into wolny:master Jul 30, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants