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

Trouble running examples #5

Open
rwaples opened this issue Feb 28, 2023 · 0 comments
Open

Trouble running examples #5

rwaples opened this issue Feb 28, 2023 · 0 comments

Comments

@rwaples
Copy link

rwaples commented Feb 28, 2023

I'm trying to get PAPI running on the examples:

I was able create a conda environment with:
conda create --name papi --file ./papi/papi_spec-file.txt

But, I am running into a number of different errors. Sorry to combine then into one issue, but it seems like these cmds may have worked in the past, but not anymore.

If I run:
python src/inference.py --inputfile ./examples/tracts.txt --ind 1 --tracefile ./example.trace --outfile OUTFILE --typ bin

I get the output:
Running inference in pymc mode
Warning: gradient not available.(E.g. vars contains discrete variables). MAP estimates may not be accurate for the default parameters. Defaulting to non-gradient minimization 'Powell'.
logp = -249.34: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 46/46 [00:00<00:00, 3164.68it/s]
Only 100 samples in chain.
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Initializing NUTS failed. Falling back to elementwise auto-assignment.
Multiprocess sampling (4 chains in 4 jobs)
CompoundStep

Slice: [t2]
Slice: [t1]
Slice: [p2]
Slice: [p1]
Sampling 4 chains, 0 divergences: 100%|███████████████████████████████████████████████████████████████████| 2400/2400 [00:05<00:00, 475.56draws/s]
The number of effective samples is smaller than 25% for some parameters.
Traceback (most recent call last):
File "src/inference.py", line 310, in
trace['t1']=trace['t1']-1
TypeError: 'MultiTrace' object does not support item assignment

If I run python src/inference.py --inputfile ./examples/tracts.txt --ind 1 --tracefile ./example.trace --outfile OUTFILE --typ full

I get the output:
Running inference in pymc mode
Traceback (most recent call last):
File "src/inference.py", line 301, in
pm.DensityDist('likelihood', lambda v: logl(v), observed={'v': theta})
File "/home/kele/mambaforge/envs/papi/lib/python3.8/site-packages/pymc3/distributions/distribution.py", line 47, in new
return model.Var(name, dist, data, total_size)
File "/home/kele/mambaforge/envs/papi/lib/python3.8/site-packages/pymc3/model.py", line 940, in Var
var = MultiObservedRV(name=name, data=data, distribution=dist,
File "/home/kele/mambaforge/envs/papi/lib/python3.8/site-packages/pymc3/model.py", line 1543, in init
self.logp_elemwiset = distribution.logp(**self.data)
File "src/inference.py", line 301, in
pm.DensityDist('likelihood', lambda v: logl(v), observed={'v': theta})
File "/home/kele/mambaforge/envs/papi/lib/python3.8/site-packages/theano/gof/op.py", line 674, in call
required = thunk()
File "/home/kele/mambaforge/envs/papi/lib/python3.8/site-packages/theano/gof/op.py", line 892, in rval
r = p(n, [x[0] for x in i], o)
File "src/inference.py", line 49, in perform
logl = self.likelihood(theta,self.data)
TypeError: lik_func() missing 1 required positional argument: 'tau'

and with:
python src/inference.py --inputfile ./examples/tracts.txt --ind 1 --tracefile ./example.trace --outfile OUTFILE --typ mrkv

Running inference in pymc mode
Warning: gradient not available.(E.g. vars contains discrete variables). MAP estimates may not be accurate for the default parameters. Defaulting to non-gradient minimization 'Powell'.
logp = 141.33: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 136/136 [00:03<00:00, 36.25it/s]
Only 100 samples in chain.
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Initializing NUTS failed. Falling back to elementwise auto-assignment.
Multiprocess sampling (4 chains in 4 jobs)
CompoundStep

Slice: [t2]
Slice: [t1]
Slice: [p2]
Slice: [p1]
Sampling 4 chains, 0 divergences: 100%|████████████████████████████████████████████████████████████████████| 2400/2400 [09:25<00:00, 4.25draws/s]
The rhat statistic is larger than 1.4 for some parameters. The sampler did not converge.
The number of effective samples is smaller than 10% for some parameters.
Traceback (most recent call last):
File "src/inference.py", line 310, in
trace['t1']=trace['t1']-1
TypeError: 'MultiTrace' object does not support item assignment

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