-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use bytes on pickle SpatialPooler and TemporalMemory #530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Lupino 👍
this looks good!
Can you please add/enable the tests which use pickle serialization to show this is working?
Hi Lupino, I think I know why you code does not work. It looks like a problem with pybind11 and python2. I found this thread discussing it: pybind/pybind11#271 Try replacing try:
import cPickle as pickle # For python 2
except ImportError:
import pickle # For python 3 |
I changed but also failed |
https://github.com/htm-community/nupic.cpp/blob/master/bindings/py/tests/nupic_random_test.py#L76 I found pickle is mark failed on this file. |
I think that the next best thing would be to detect which version of python is running and skip the unit tests if it's python 2. Then at least we can have this working and tested for python3. The pytest docs have some examples of how to do this: |
This ended up a really nice PR! Thank you @Lupino 👍 |
Fixed UnicodeDecodeError, when pickle SpatialPooler or TemporalMemory
#160