-
Notifications
You must be signed in to change notification settings - Fork 52
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
pm.sample cannot pickle LimbDark object #115
Comments
You won't be able to run that as a script on macOS with Python 3.8 because of issues with how multiprocessing now works. You'll need to wrap your script in a Unfortunately there's not much to do from within exoplanet except add a page to the docs so I'm going to relabel this as a documentation issue rather than a bug. Related issues: |
I get this error as well on Linux when simply trying to pickle the model in docs/tutorials/transit.py. Like: with open("test.pickle", "wb") as f:
pickle.dump(model, f)
It works with |
OK - I'll take a look into this because it would be good to be able to pickle these models, but I don't understand why I haven't run into a sampling issue before if you're still getting it. I use parallel sampling on macos and ubuntu every day with v0.4 and the tutorial is automatically run on CI for every push. |
This is puzzling indeed. I will try to investigate as well what could be wrong in my process. For reference: Before running into the last point I tried using |
This will all have something to do with running in a Jupyter environment vs a script. These tutorials are designed to be run using jupytext, not directly as a script. #120 fixes the issue with pickling and #121 will track documenting best practices for running parallel sampling as a script (this is where the |
Error
Getting
TypeError: cannot pickle 'exoplanet.theano_ops.driver.LimbDark' object
when sampling a model containingLimbDarkLightCurve
Reproduction
Fresh virtualenv with
exoplanet
,pymc3
,tqdm
installedpython3 -m venv xotest source ./xotest/bin/activate.fish pip install tqdm exoplanet pymc3
and running docs/tutorials/transit.py
cd xotest curl -O https://raw.githubusercontent.com/exoplanet-dev/exoplanet/main/docs/tutorials/transit.py python ./transit.py
Setup:
The text was updated successfully, but these errors were encountered: