-
-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7f253aa720d0>: attribute lookup <lambda> on __main__ failed #9467
Comments
@evotjh You define your pre-processor and tokenizers for CountVectorizer as a lambda functions. The builtin Python pickle (on which joblib depends) can't pickle those. The solution is to,
|
@rth, would you mind submitting an addition to our FAQ? Thanks.
…On 1 August 2017 at 21:02, Roman Yurchak ***@***.***> wrote:
@evotjh <https://github.com/evotjh> You define your pre-processor and
tokenizers for CountVectorizer as a lambda functions. The builtin Python
pickle (on which joblib depends) can't pickle those.
The solution is to,
- either define those two as regular functions before the pipeline
(recommended)
- try to see if importing dill in your script fixes this issue as
suggested here <https://stackoverflow.com/a/25353243/1791279>
(probably not recommended, but I'm curious to know the results ) )
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9467 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6-OyizT6MCJCkpX8REZxRkAKmPOiks5sTwW8gaJpZM4OpjDd>
.
|
|
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7f253aa720d0>: attribute lookup <lambda> on __main__ failed
when executing on more than 1 cores:
Steps/Code to Reproduce
Expected Results
Should work as it does with njobs=1.
Actual Results
Versions
Linux-3.19.0-80-generic-x86_64-with-Ubuntu-14.04-trusty
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4]
NumPy 1.13.1
SciPy 0.19.1
Scikit-Learn 0.18.2
The text was updated successfully, but these errors were encountered: