-
Notifications
You must be signed in to change notification settings - Fork 1.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
Pickling is problematic #323
Comments
This is also true when pickling any other user class in Python.
Le lun. 31 déc. 2018 11 h 12, max3-2 <notifications@github.com> a écrit :
… When pickling a dict with deap Individuals, unpickling is only possible
when the Fitness and the Individuals have been created. This makes using
those pickling tedious. This might be a duplicate o f PR#76. Has this been
fixed or at least considered?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#323>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6rwmFlEiq1tgOHqThnmS7Jk6rFPpEAks5u-jdxgaJpZM4ZlhcB>
.
|
@fmder how is possible to solve the pickling issue? I am storing the best genome following way: with open('winner_{0}'.format(hof[0].key), 'wb') as winner:
pickle.dump(hof[0], winner) However the unpickling does not work:
any suggestions? |
Import the creator from your original script and make sure that class creation is made at the module level. This is more of a pickling question than a deap question. You can get more information on user class pickling on stack overflow. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When pickling a dict with deap Individuals, unpickling is only possible when the Fitness and the Individuals have been created. This makes using those pickling tedious. This might be a duplicate o f PR#76. Has this been fixed or at least considered?
#280 seems to have already implemented this
The text was updated successfully, but these errors were encountered: