GFZ / arosics

AROSICS - Automated and Robust Open-Source Image Co-Registration Software
https://git.gfz-potsdam.de/danschef/arosics
Apache License 2.0
137 stars 26 forks source link

TypeError: Parallel.__init__() got an unexpected keyword argument 'return_as' #39

Closed danschef closed 2 months ago

danschef commented 3 months ago

I have no problem with co-registration using the Global approach. However, the error message below occurs when trying the local registration, even when I use only 1 CPU. Different grid_res same error. Any suggestions? arosics version: 1.10.2 Python version: 3.11.8 Operating System: Windows 11

>>> COREG_LOCAL(
...     "path_to/RefImage.tif",
...     "path_to/SourceImage.tif",
...     grid_res=50,
...     window_size=(256, 256),
...     r_b4match=1,
...     path_out=None,
...     CPUs=1,
...     q=False
... ).correct_shifts()
Calculating footprint polygon and actual data corner coordinates for reference image...
Bounding box of calculated footprint for reference image:
        (474683.0, 6686905.0, 476442.0, 6691721.0)
Calculating footprint polygon and actual data corner coordinates for image to be shifted...
Polygonize progress     |==================================================| 100.0% Complete  => 0:00:00
Bounding box of calculated footprint for image to be shifted:
        (474682.96922200004, 6686904.749473, 476441.569222, 6691721.099473)
Matching window position (X,Y): 475562.28606702085/6689313.000074867
Initializing tie points grid...
Equalizing pixel grids and projections of reference and target image...
Warping progress     |==================================================| 100.0% Complete  => 0:00:18
Warping progress     |==================================================| 100.0% Complete  => 0:00:01
Calculating tie point grid (16692 points) using 1 CPU cores...
Traceback (most recent call last):
  File "<stdin>", line 10, in <module>
  File "d:\pygis\Lib\site-packages\arosics\CoReg_local.py", line 821, in correct_shifts
    self.calculate_spatial_shifts()
  File "d:\pygis\Lib\site-packages\arosics\CoReg_local.py", line 491, in calculate_spatial_shifts
    self._tiepoint_grid.get_CoRegPoints_table()
  File "d:\pygis\Lib\site-packages\arosics\Tie_Point_Grid.py", line 345, in get_CoRegPoints_table
    Parallel(n_jobs=self.CPUs, **kw_parallel)(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Parallel.__init__() got an unexpected keyword argument 'return_as'

Originally posted by @leikas227 in https://github.com/GFZ/arosics/issues/36#issuecomment-2031087345

danschef commented 3 months ago

@leikas227 The reason here is that the return_as parameter does not exist in joblib<1.3.0. I will add a minimal version pinning.

danschef commented 3 months ago

See https://git.gfz-potsdam.de/danschef/arosics/-/merge_requests/52. This will be part of v1.10.3. The conda-forge package will be directly updated in https://github.com/conda-forge/arosics-feedstock/pull/78 (new build should be available soon).