pymc-devs / pymc2

THIS IS THE **OLD** PYMC PROJECT (VERSION 2). PLEASE USE PYMC INSTEAD:
http://pymc-devs.github.com/pymc/
Other
879 stars 229 forks source link

Fundamental AttributeError when running PyMC that I cannot trace #125

Closed steveehlert closed 8 years ago

steveehlert commented 8 years ago

Hi all-

I have run into a very unusual issue with a PyMC run I am trying and I cannot explain why it is failing. Mainly, I want to do some MCMC sampling of a single sample of measurements against a custom scipy stats distribution, and for some reason the MCMC run is completely failing for reasons I cannot ascertain. The relevant code is below, but I don't see why it is giving me the failure of

AttributeError: 'builtin_function_or_method' object has no attribute 'dict'

This seems like a rather serious failure for something that is rather trivial conceptually. Any ideas where this came from and how to fix it? Thanks in advance!

Steven Ehlert

fonnesbeck commented 8 years ago

I'd need to see the full error log to debug this. Its probably something to do with the scipy functions, as I have never seen this error before.

steveehlert commented 8 years ago

This is the full output I am seeing. I agree that the scipy functions are a likely culprit but I cannot seem to trace it to them.

Traceback (most recent call last): File "SimulateMassIndex.py", line 123, in MCMCModel=pymc.MCMC(PowerLawModel(meteorsample), db='txt',dbname="SimModelMC",verbose=5) #Here is the MCMC run File "/home/sehlert/massindex/massindex/local/lib/python2.7/site-packages/pymc/MCMC.py", line 90, in init kwds) File "/home/sehlert/massindex/massindex/local/lib/python2.7/site-packages/pymc/Model.py", line 191, in init Model.init(self, input, name, verbose) File "/home/sehlert/massindex/massindex/local/lib/python2.7/site-packages/pymc/Model.py", line 92, in init ObjectContainer.init(self, input) File "/home/sehlert/massindex/massindex/local/lib/python2.7/site-packages/pymc/Container.py", line 605, in init input_to_file = input.dict AttributeError: 'builtin_function_or_method' object has no attribute 'dict**'

fonnesbeck commented 8 years ago

How about this: return locals() instead of return locals.

steveehlert commented 8 years ago

Yup, that did it. I can't believe I forgot the () on the end of locals. Sorry to have wasted your time.

fonnesbeck commented 8 years ago

No problem. Happens to me all the time.