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 when vars specified in backend #3256

Closed
roblem opened this issue Nov 15, 2018 · 3 comments
Closed

Bug with SQLite as backend when vars specified in backend #3256

roblem opened this issue Nov 15, 2018 · 3 comments
Labels

Comments

@roblem
Copy link

roblem commented Nov 15, 2018

Related to #3146 . This error continues to occur when vars is specified. This works

with model:
    backend = pm3.backends.SQLite('/path/to/database.sqlite')
    # step method
    step = pm3.NUTS([x, y, z])
    trace = pm3.sample(5000, step, trace=backend)

but this doesn't

with model:
    # note vars specified for not storing all variables in backend
    backend = pm3.backends.SQLite('/path/to/database.sqlite',
                    vars=[x, y])
    # step method
    step = pm3.NUTS([x, y, z])
    trace = pm3.sample(5000, step, trace=backend)

with this error

Multiprocess sampling (4 chains in 4 jobs)
NUTS: [x, y, z]
Sampling 4 chains:  Traceback (most recent call last):
  File "~/anaconda/envs/pymc3_master/lib/python3.6/site-packages/pymc3/backends/sqlite.py", line 164, in _execute_queue
    self._queue[varname])
sqlite3.ProgrammingError: Cannot operate on a closed cursor.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/anaconda/envs/pymc3_master/lib/python3.6/site-packages/pymc3/sampling.py", line 999, in _mp_sample
    trace.close()
  File "~/anaconda/envs/pymc3_master/lib/python3.6/site-packages/pymc3/backends/sqlite.py", line 170, in close
    self._execute_queue()
  File "~/anaconda/envs/pymc3_master/lib/python3.6/site-packages/pymc3/backends/sqlite.py", line 165, in _execute_queue
    self._queue[varname] = []
sqlite3.ProgrammingError: Cannot operate on a closed database.
@ndtallant
Copy link

Is this still an issue? I'd like to work on it this weekend if it is open!

@roblem
Copy link
Author

roblem commented Mar 29, 2019

Still an issue.

@ColCarroll
Copy link
Member

Contributions would be welcome, but hoping to deprecate most backends #2189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants