-
Notifications
You must be signed in to change notification settings - Fork 170
Open
Description
There have been reports of the mpire distributed WPF optimization failing with errors like
AttributeError: Can't pickle local object 'WholePatternFit._fit_distributed.<locals>.f
This appears to only affect Windows systems.
I think the fix is to enable dill serialization:
py4DSTEM/py4DSTEM/process/wholepatternfit/wpf.py
Lines 748 to 753 in 1137637
| with WorkerPool( | |
| n_jobs=num_jobs, | |
| shared_objects=fit_opts, | |
| ) as pool: | |
| results = pool.map( |
should be modified to become:
with WorkerPool(
n_jobs=num_jobs,
shared_objects=fit_opts,
use_dill=True,
) as pool:mpire produces threads differently on Windows vs UNIX and so there can be serialization errors that only show up one one platform when transmitting complicated objects to threads. Unfortunately I do not have a Windows machine to test this on at the moment, so someone else will have to try this and let us know.
smribet and bsavitzky
Metadata
Metadata
Assignees
Labels
No labels