Discussion:
[theano-users] Re: Function that should return dict returns list after pickling
Pascal Lamblin
2017-08-04 17:48:55 UTC
Permalink
Thanks for the report.
I've added that to the list of things we should fix in pickling and
unpickling Function object, see https://github.com/Theano/Theano/issues/5736
X = T.vector()
theano_func = theano.function([X], {'vec':X**2})
theano_func([2,3,4])
{'vec': array([ 4., 9., 16.], dtype=float32)}
pickle.dump(theano_func, f, protocol=pickle.HIGHEST_PROTOCOL)
func_loaded = pickle.load(f)
func_loaded([2,3,4])
[array([ 4., 9., 16.], dtype=float32)]
So for some reason after pickling/unpickling the function returns a list instead of dict. Any ideas?
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-08-08 03:51:42 UTC
Permalink
This is fixed in https://github.com/Theano/Theano/pull/6275

Fred
Post by Pascal Lamblin
Thanks for the report.
I've added that to the list of things we should fix in pickling and
unpickling Function object, see
https://github.com/Theano/Theano/issues/5736
X = T.vector()
theano_func = theano.function([X], {'vec':X**2})
theano_func([2,3,4])
{'vec': array([ 4., 9., 16.], dtype=float32)}
pickle.dump(theano_func, f, protocol=pickle.HIGHEST_PROTOCOL)
func_loaded = pickle.load(f)
func_loaded([2,3,4])
[array([ 4., 9., 16.], dtype=float32)]
So for some reason after pickling/unpickling the function returns a list instead of dict. Any ideas?
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...