balbasty / nitorch

Neuroimaging in PyTorch
Other
83 stars 14 forks source link

_optimize #68

Closed JohnAshburner closed 2 years ago

JohnAshburner commented 2 years ago

I get the following error because _minimize_powell seems to be in scipy.optimize._optimize

File "/home/john/miniconda3/lib/python3.9/site-packages/nitorch/tools/affine_reg/_core.py", line 5, in <module>
    from scipy.optimize.optimize import _minimize_powell
ImportError: cannot import name '_minimize_powell' from 'scipy.optimize.optimize' (/home/john/miniconda3/lib/python3.9/site-packages/scipy/optimize/optimize.py)

The scipy version I'm trying to use is

(base) john@ash:~/python/project_nitorch_scribbles$ pip show scipy
Name: scipy
Version: 1.8.0
Summary: SciPy: Scientific Library for Python
Home-page: https://www.scipy.org
Author: 
Author-email: 
License: BSD
Location: /home/john/miniconda3/lib/python3.9/site-packages
Requires: numpy
Required-by: nitorch
balbasty commented 2 years ago

@brudfors Mikael, would you have some time to look into this? It would be nicer to use one of the public API functions (e.g. https://docs.scipy.org/doc/scipy/reference/optimize.minimize-powell.html)

balbasty commented 2 years ago

I think I fixed it in e1132ac, but I did not test it...

brudfors commented 2 years ago

Thanks @balbasty, I think I used that function as I needed access to some parameter that was not accesible through the public API.