Closed ivan-chai closed 3 years ago
I think the problem is that we can't pickle the lambda function. You will need to import dill or something like it and use that instead of the native pickle module.
So probably import dill
at the start of your script can help.
I tried dill, but unfortunately multiprocessing and dill can't do together.
One possible solution is to replace lambdas with callable objects.
so, the custom callable-based functional workaround works for now, right? @ivan-chai
Yes, I made callable and it is fine.
@ditwoo as a ControlFlow-father do you have any suggestions?
@asteyo could you please help with an issue?
I think some refactoring of filtering-fns
from
def _filter_fn_from_XXX({params}):
{filter-logic}
to
class _filter_fn_from_XXX:
def __init__(self, {params}):
pass
def __call__(self, stage, epoch, loader):
{filter-logic}
should solve the issue 🚀
should be fixed with 21.10
🐛 Bug Report
ControlFlowCallback can't be pickled because of lambdas in
def _filter_fn_from_loaders
.It works fine when callbacks are initialized in
def get_callbacks
, but fails if callbacks are passed directly to SupervisedRunner.train method.Environment