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

Multiprocessing can not pickle unbound function #11

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 6 comments
Closed

Multiprocessing can not pickle unbound function #11

GoogleCodeExporter opened this issue Mar 16, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Using the neurolab Net modules is not possible to parallelize its execution due 
to the unbound functions are unpickable through queues.

It could be solved not defining unbound functions of trainf or errof during the 
instantiation of the Net structure. Its just a fast solution, defininf the 
errorf and trainf as strings and calling them in the right moment as in error 
function calling:

return getattr(error, net.errof)(target - output)

Original issue reported on code.google.com by yeray.al...@gmail.com on 6 Mar 2014 at 1:13

@GoogleCodeExporter
Copy link
Author

You may give code that does not work?
Perhaps the problem can be solved in another way 

 getattr (error, net.errof) (target - output) 

not look very nice

Original comment by zue...@gmail.com on 7 Mar 2014 at 6:11

@GoogleCodeExporter
Copy link
Author

I fix pickled net in v 0.3.3. Please test it!

Original comment by zue...@gmail.com on 17 Mar 2014 at 3:01

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

I had to make changes to use neurolab in python3.x. It seems to be still 
incompatible. Are you thinking on make it compatible?. Thanks

Original comment by yeray.al...@gmail.com on 24 Mar 2014 at 1:44

@GoogleCodeExporter
Copy link
Author

v 0.3.3 is pickeble in python 3. For save/load network in PY3 you may use next 
fucntionis:

def load(fname):
    from pickle import load

    with open(fname, 'rb') as file:
        net = load(file)

    return net

def save(net, fname):
    from pickle import dump

    with open(fname, 'wb') as file:
        dump(net, file)

I update it in next version

Original comment by zue...@gmail.com on 25 Mar 2014 at 7:01

@GoogleCodeExporter
Copy link
Author

functions updated in v 0.3.4

Original comment by zue...@gmail.com on 1 Apr 2014 at 3:42

@GoogleCodeExporter
Copy link
Author

Net object now is pickeble

Original comment by zue...@gmail.com on 1 Apr 2014 at 3:43

  • Changed state: Fixed

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

No branches or pull requests

1 participant