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

cg() got an unexpected keyword argument 'tol' #7896

Closed
KumoLiu opened this issue Jul 2, 2024 · 0 comments · Fixed by #7897
Closed

cg() got an unexpected keyword argument 'tol' #7896

KumoLiu opened this issue Jul 2, 2024 · 0 comments · Fixed by #7897
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 2, 2024

======================================================================
ERROR: test_against_official_code_using_cg (tests.test_ultrasound_confidence_map_transform.TestUltrasoundConfidenceMapTransform)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/MONAI/MONAI/tests/test_ultrasound_confidence_map_transform.py", line 699, in test_against_official_code_using_cg
    output = transform(input_img)
  File "/home/runner/work/MONAI/MONAI/monai/transforms/intensity/array.py", line 2878, in __call__
    conf_map: NdarrayOrTensor = self._compute_conf_map(img_np, mask_np)
  File "/home/runner/work/MONAI/MONAI/monai/data/ultrasound_confidence_map.py", line 381, in __call__
    map_: NDArray = self.confidence_estimation(data, seeds, labels, self.beta, self.gamma)
  File "/home/runner/work/MONAI/MONAI/monai/data/ultrasound_confidence_map.py", line 338, in confidence_estimation
    x = self._solve_linear_system(lap, rhs)
  File "/home/runner/work/MONAI/MONAI/monai/data/ultrasound_confidence_map.py", line 288, in _solve_linear_system
    x, _ = cg(lap, rhs, tol=self.cg_tol, maxiter=self.cg_maxiter, M=m)
TypeError: cg() got an unexpected keyword argument 'tol'
@KumoLiu KumoLiu added the bug Something isn't working label Jul 2, 2024
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Jul 2, 2024
Signed-off-by: YunLiu <[email protected]>
ericspod pushed a commit that referenced this issue Jul 6, 2024
Fixes #7896 

### Description

- 'scipy.sparse.linalg.cg' keyword argument `tol` is deprecated in favor
of `rtol` and will be removed in SciPy v1.14.0. Until then, if set, it
will override `rtol`. So update to use `rtol` in `cg`.

- Drop python 3.8 test in packaging and premerge-gpu-test.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: YunLiu <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant