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

Bug with SQLite as backend #3146

Closed
springcoil opened this issue Aug 10, 2018 · 0 comments · Fixed by #3148
Closed

Bug with SQLite as backend #3146

springcoil opened this issue Aug 10, 2018 · 0 comments · Fixed by #3148
Assignees
Labels

Comments

@springcoil
Copy link
Contributor

springcoil commented Aug 10, 2018

I've come across this bug. I'm trying to reproduce the bioassay_model - and pass that to the backend.

Has something changed with backend trace?

ProgrammingError                          Traceback (most recent call last)
<ipython-input-32-9f8ba87a6c6a> in <module>()
      1 with bioassay_model:
----> 2     db_trace = pm.sample(100, trace='sqlite')

~/miniconda3/envs/stat-rethink-pymc3/lib/python3.6/site-packages/pymc3/sampling.py in sample(draws, step, init, n_init, start, trace, chain_idx, chains, cores, tune, nuts_kwargs, step_kwargs, progressbar, model, random_seed, live_plot, discard_tuned_samples, live_plot_kwargs, compute_convergence_checks, use_mmap, **kwargs)
    447             _print_step_hierarchy(step)
    448             try:
--> 449                 trace = _mp_sample(**sample_args)
    450             except pickle.PickleError:
    451                 _log.warning("Could not pickle model, sampling singlethreaded.")

~/miniconda3/envs/stat-rethink-pymc3/lib/python3.6/site-packages/pymc3/sampling.py in _mp_sample(draws, tune, step, chains, cores, chain, random_seed, start, progressbar, trace, model, use_mmap, **kwargs)
   1013         finally:
   1014             for trace in traces:
-> 1015                 trace.close()
   1016 
   1017     else:

~/miniconda3/envs/stat-rethink-pymc3/lib/python3.6/site-packages/pymc3/backends/sqlite.py in close(self)
    165 
    166     def close(self):
--> 167         self._execute_queue()
    168         self.db.close()
    169 

~/miniconda3/envs/stat-rethink-pymc3/lib/python3.6/site-packages/pymc3/backends/sqlite.py in _execute_queue(self)
    162                 self.db.cursor.executemany(self.var_inserts[varname],
    163                                            self._queue[varname])
--> 164                 self._queue[varname] = []
    165 
    166     def close(self):

ProgrammingError: Cannot operate on a closed database.```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants