Closed noahaskell closed 8 years ago
Can you check to see that the quotes around 'a'
are actual ascii quotes and not unicode quotes? This can sometimes happen if you've cut an pasted code from a pdf or a website, for example. Alternately you could try install in Python 3, which I recommend anyway. Easy to do via Anaconda.
I typed it all out in vim, so I'm not sure how the quotes could be unicode and not ascii. But how can I check to make sure?
Does pymc2 work with Python 3? The model I'm actually trying to fit uses an imported multivariate normal cdf function in one of the deterministic nodes. I have a version of it implemented in pymc3 (using Python 3), but I have to use metropolis sampling because of the cdf function (which is used in an as_op
function). The added compilation time for pymc3 doesn't seem to be worth it, and pymc2 seems to be working fairly well for this model. I just want to fit it in parallel.
I can invoke multiple instances of IPython and run the script from each of those, and it works fine, even on my Mac Pro, but I don't know if that's actually running the chains in parallel in a useful way.
The version numbers of PyMC and Python are not related to one another. I haven't used Python 2.7 for a couple years now.
Okay, good to know. I thought I had run into problems trying to use PyMC 2 with Python 3, but maybe I'm misremembering something. I just recently upgraded to Python 3.
Everything works fine in Python 3. For what it's worth, installing PyMC2 broke my PyMC3 installation, but I uninstalled PyMC3 and Theano then reinstalled PyMC3 (which also reinstalled Theano, of course), and both PyMC2 and PyMC3 seem to work fine.
I'm trying to fit pymc2 models in parallel using ipyparallel on a Mac Pro, and I'm getting weird errors related to strings. Here's my system information:
I'm using pymc version 2.3.6. Here's an example script that produces the error(s) in question:
I have that saved as
test_script.py
, and then I try to run the following script, either from the command prompt or in IPython:At which point I get the following Traceback:
If I replace the string in line 18 with
str('a')
(and similarly for the other named variables in the model), I then get this error:If I change line 39 to
db_name = str('regression_MC_' + time_string + '.hdf5')
, or if I try to usestr()
with the individual parts oftime_string
, I get the same error.This only happens on my Mac Pro. I can get pymc2 to cooperate with ipyparallel on an iMac, for example. But given the larger number of processors in the Mac Pro, I would dearly love to get this working on that computer. Thanks.