question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: cannot pickle 'starry._c_ops.Ops' object

See original GitHub issue

The eclipsing binary example notebook with MCMC is failing at the NUTS sampling step. It has something to do with the new version of PyMC3 (3.9) because it works fine with PyMC3 3.7.

The following cell fails with the error TypeError: cannot pickle 'starry._c_ops.Ops' object:

with model:
    trace = pm.sample(
        tune=500,
        draws=500,
        start=map_soln,
        chains=4,
        step=xo.get_dense_nuts_step(target_accept=0.9),
    )

It works if you set chains=1.

Starry version: 1.0.1.dev161+g9c462a2c exoplanet version: 0.3.3 PyMC3 version: 3.9.3 macOS Catalina install from source

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rodlugercommented, Sep 10, 2020

Looking at @bmorris3’s comment, the workaround is

import multiprocessing as mp

pm.sample(
    ..., 
    mp_ctx=mp.get_context("fork")
)
1reaction
dfmcommented, Sep 10, 2020

It’s all the same issue and it’s really a Python issue, not pymc3 really. I’ve found that using fork instead of forkserver works fine in general.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: can't pickle module objects error - Stack Overflow
I can reproduce the error message this way: import cPickle class Foo(object): def __init__(self): self.mod=cPickle foo=Foo() with file('/tmp/test.out', ...
Read more >
How to set sparkTrials? I am receiving this TypeError
I am receiving this TypeError: cannot pickle '_thread.lock' object. I am trying to distribute hyperparameter tuning using hyperopt on a tensorflow.keras ...
Read more >
Untitled
Hadek el youm, Mats berggren wiki, Schnellste ustermer schulklasse, V zakone, Restaurants in wiltz luxembourg, Ic colombo frattaminore, Mario can't destroy ...
Read more >
wordlist_3-2.txt
... miles 849 following 847 word 843 city 841 party 834 can't 831 really 831 ... 394 officers 394 whatever 394 paris 393...
Read more >
ED 264 588 AUTHOR TITLE REPORT NO AVAILABLE ... - ERIC
objects around them. The layout of the book allows children to guess an object before they actually see it. The book is excellent....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found