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

Tutorial Error for Trace Function #292

Open
Stefan-Physics opened this issue Jun 16, 2023 · 0 comments
Open

Tutorial Error for Trace Function #292

Stefan-Physics opened this issue Jun 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Stefan-Physics
Copy link

Describe the bug
A clear and concise description of what the bug is.
In the tutorial whenever I have to use trace. For example, in ‘a quick intro to pymc3’, the code
trace = pm.sample(
draws=1000, tune=1000, chains=2, cores=2, return_inferencedata=True)
Gives an error:
“AttributeError: module 'arviz' has no attribute 'from_pymc3' “

To Reproduce
This section should include a simple, standalone code snippet that demonstrates the issue.

!pip install exoplanet
!python -m pip install -U "exoplanet[extras]"
!python -m pip install tensorflow==2.11.1
!python -m pip install tensorflow-datasets==4.9
!python -m pip install tensorflow-metadata==1.13
!python -m pip install protobuf==3.19.6
!python -m pip install pymc==5.1.1
!python -m pip install pymc3==3.11.4
import exoplanet as xo

import pymc3 as pm
import arviz as az

with pm.Model() as model:
m = pm.Uniform("m", lower=-5, upper=5)
b = pm.Uniform("b", lower=-5, upper=5)
logs = pm.Uniform("logs", lower=-5, upper=5)
pm.Normal("obs", mu=m * x + b, sd=pm.math.exp(logs), observed=y)
trace = pm.sample(
draws=1000, tune=1000, chains=2, cores=2, return_inferencedata=True
)

Expected behavior
A clear and concise description of what you expected to happen.
It should perform the trace function like in the tutorial.

Your setup (please complete the following information):

  • Version of exoplanet: 0.5.3
  • Operating system: IPad, google collab
  • Python version & installation method (pip, conda, etc.): !pip through google collab

Additional context
Add any other context about the problem here.

I believe this error is due to an update on pymc3 that “the Latest PyMC3 release (3.11.0) is the first to not include the alias such as pm.traceplot. You have to use [arviz.plot_trace]which works with PyMC3 objects.” OriolAbril from stack overflow.

Additionally, and maybe this is the problem. Due to some dependencies, I had to downgrade certain things in exoplanet to get it to run on google collaborator. The code to get it to run in collab is what I pasted earlier with the code I got the error from:

!pip install exoplanet
!python -m pip install -U "exoplanet[extras]"
!python -m pip install tensorflow==2.11.1
!python -m pip install tensorflow-datasets==4.9
!python -m pip install tensorflow-metadata==1.13
!python -m pip install protobuf==3.19.6
!python -m pip install pymc==5.1.1
!python -m pip install pymc3==3.11.4
import exoplanet as xo

Lastly, I am an undergraduate student, so I apologize if this is an elementary error.

@Stefan-Physics Stefan-Physics added the bug Something isn't working label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant