Skip to content

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
ch0314 pushed a commit to ch0314/pytorch-3dunet-warboy that referenced this pull request Jun 6, 2025
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