nansencenter / sea_ice_drift

Sea ice drift from Sentinel-1 SAR imagery using open source feature tracking
GNU General Public License v3.0
44 stars 18 forks source link

AttributeError: Can't pickle local object 'pattern_matching.<locals>._init_pool' #30

Open YU9684 opened 3 months ago

YU9684 commented 3 months ago

Hello, I'm running the simple.py file with AttributeError: can't pickle local object 'pattern_matching.. _init_pool', how can I solve this? Thank you.

The specific error is as follows:

C:\Users\YU.conda\envs\sea-ice-drift\python.exe F:\Ydata\code\sea-ice-drift\sea-ice-drift\sea_ice_drift\examples\simple.py Cannot add landmask VMIN: -22.628240203857423 VMAX: -9.868122138977043 Cannot add landmask VMIN: -23.267868041992188 VMAX: -10.92607064247131 Traceback (most recent call last): File "F:\Ydata\code\sea-ice-drift\sea-ice-drift\sea_ice_drift\examples\simple.py", line 66, in upm, vpm, apm, rpm, hpm, lon2pm, lat2pm = sid.get_drift_PM( ^^^^^^^^^^^^^^^^^ File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\site-packages\sea_ice_drift-0.7.1-py3.11.egg\sea_ice_drift\seaicedrift.py", line 87, in get_drift_PM File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\site-packages\sea_ice_drift-0.7.1-py3.11.egg\sea_ice_drift\pmlib.py", line 442, in pattern_matching File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\pool.py", line 215, in init self._repopulate_pool() File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\pool.py", line 329, in _repopulate_pool_static w.start() File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\process.py", line 121, in start self._popen = self._Popen(self) ^^^^^^^^^^^^^^^^^ File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\context.py", line 336, in _Popen return Popen(process_obj) ^^^^^^^^^^^^^^^^^^ File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\popen_spawn_win32.py", line 95, in init reduction.dump(process_obj, to_child) File "C:\Users\YU.conda\envs\sea-ice-drift\Lib\multiprocessing\reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object 'pattern_matching.._init_pool'