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

WalkerSampler.walker_v.f.value is ndarray? #75

Closed
borisaqua opened this issue Dec 21, 2011 · 2 comments
Closed

WalkerSampler.walker_v.f.value is ndarray? #75

borisaqua opened this issue Dec 21, 2011 · 2 comments

Comments

@borisaqua
Copy link
Contributor

When running walker lake gp example, plotting realization fails:

Traceback (most recent call last):
File "mcmc.py", line 97, in
R = WalkerSampler.walker_v.f.value(dplot)
TypeError: 'numpy.ndarray' object is not callable

In addition, walker lake dataset is not available at http://www.ai-geostats.org/fileadmin/Documents/Data/walker_01.dat anymore.

@borisaqua
Copy link
Contributor Author

Using hdf5 backend results in walker_v.f.value being a 0-d array containing a Realization object, so
R = WalkerSampler.walker_v.f.value() would work.

However, if using 'ram', walker_v.f.value, as expected, is a Realization object.

I also have another piece of code that works with 'ram', but fails with 'hdf5' for an opposite reason--Realization object is not wrapped in a 0-rank ndarray:

/usr/local/lib/python2.7/dist-packages/pymc/database/hdf5.py:448: UserWarning: 5
Error tallying Hc_f, will not try to tally it again this chain.
Did you make all the samevariables and step methods tallyable
as were tallyable last time you used the database file?

Error:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pymc/database/hdf5.py", line 438, in tally
self._traces[name].tally(chain)
File "/usr/local/lib/python2.7/dist-packages/pymc/database/hdf5.py", line 57, in tally
self._vlarrays[chain].append(self.getfunc())
File "/usr/lib/python2.7/dist-packages/tables/vlarray.py", line 468, in append
sequence = atom.toarray(sequence)
File "/usr/lib/python2.7/dist-packages/tables/atom.py", line 996, in toarray
buffer
= self.tobuffer(object)
File "/usr/lib/python2.7/dist-packages/tables/atom.py", line 1112, in tobuffer
return cPickle.dumps(object
, 0)
File "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
raise TypeError, "can't pickle %s objects" % base.name
TypeError: can't pickle function objects

@borisaqua
Copy link
Contributor Author

Upgrade to numpy-1.6.1 appears to solve the problem.

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

1 participant