Skip to content
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

Seems Like Unpack is not Picklable #44

Closed
rizar opened this issue Mar 12, 2015 · 4 comments
Closed

Seems Like Unpack is not Picklable #44

rizar opened this issue Mar 12, 2015 · 4 comments

Comments

@rizar
Copy link
Contributor

rizar commented Mar 12, 2015

My first attempt to use it ended up with the message below. I could not immediately find the reason in the code, will look later.

cPickle.PicklingError: Pickling failed.

Blocks relies on the ability to pickle the entire main loop, which includes all bricks, data streams, extensions, etc. All of these must be serializable using Pythons pickling library. This means certain things such as nested functions, lambda expressions, generators, etc. should be avoided. Please see the documentation for more detail.

Original exception:
        PicklingError: Can't pickle <type 'iterator'>: attribute lookup __builtin__.iterator failed

Original exception:
        PicklingError: Pickling failed.

Blocks relies on the ability to pickle the entire main loop, which includes all bricks, data streams, extensions, etc. All of these must be serializable using Pythons pickling library. This means certain things such as nested functions, lambda expressions, generators, etc. should be avoided. Please see the documentation for more detail
@rizar
Copy link
Contributor Author

rizar commented Mar 16, 2015

Localized: this happens when numpy.array is unpacked, because picklable_itertools does not know about such an object, that is it's iter_ method simply calls global iter.

@dwf, do you think we should teach picklable_itertools to handle numpy arrays?

@dwf
Copy link
Contributor

dwf commented Mar 16, 2015 via email

@dwf
Copy link
Contributor

dwf commented Mar 16, 2015

Fixed in mila-iqia/picklable-itertools@825eb0f. @rizar please confirm it works with Unpack (someone might want to write a test, so I opened #46, which you can feel free to tackle or not).

@rizar
Copy link
Contributor Author

rizar commented Mar 17, 2015

I confirm that it works, covering it with a regression test can wait in the CCW queue a bit, I guess :) This was not Fuel's fault anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants