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

HOW TO SOLVE THIS PROBLEM in train #42

Open
quuhua911 opened this issue Jul 21, 2019 · 2 comments
Open

HOW TO SOLVE THIS PROBLEM in train #42

quuhua911 opened this issue Jul 21, 2019 · 2 comments

Comments

@quuhua911
Copy link

when run "train.py --seed 1 --bS 16 --accumulate_gradients 2 --bert_type_abb uS --fine_tune --lr 0.001 --lr_bert 0.00001 --max_seq_leng 222"

HOW TO SOLVE THIS PROBLEM
this is the error :
/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/torch/nn/functional.py:1386: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
Error closing cursor
Traceback (most recent call last):
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1268, in fetchone
row = self._fetchone_impl()
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1148, in _fetchone_impl
return self.cursor.fetchone()
sqlite3.ProgrammingError: Cannot operate on a closed database.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1333, in _safe_close_cursor
cursor.close()
sqlite3.ProgrammingError: Cannot operate on a closed database.
Traceback (most recent call last):
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1268, in fetchone
row = self._fetchone_impl()
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1148, in _fetchone_impl
return self.cursor.fetchone()
sqlite3.ProgrammingError: Cannot operate on a closed database.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train.py", line 605, in
dset_name='train')
File "train.py", line 310, in train
cnt_x1_list, g_ans, pr_ans = get_cnt_x_list(engine, tb, g_sc, g_sa, sql_i, pr_sc, pr_sa, pr_sql_i)
File "/home/quh/pythonwork/nl2sql/nl2sql_baseline/sqlova/sqlova/utils/utils_wikisql.py", line 1652, in get_cnt_x_list
g_ans1 = engine.execute(tb[b]['id'], g_sc[b], g_sa[b], g_sql_i[b]['conds'])
File "/home/quh/pythonwork/nl2sql/nl2sql_baseline/sqlova/sqlnet/dbengine.py", line 29, in execute
table_info = self.db.query('SELECT sql from sqlite_master WHERE tbl_name = :name', name=table_id).all()[0].sql.replace('\n','')
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/records.py", line 195, in all
rows = list(self)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/records.py", line 126, in iter
yield next(self)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/records.py", line 136, in next
nextrow = next(self._rows)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/records.py", line 365, in
row_gen = (Record(cursor.keys(), row) for row in cursor)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 946, in iter
row = self.fetchone()
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1276, in fetchone
e, None, None, self.cursor, self.context
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
util.raise_from_cause(sqlalchemy_exception, exc_info)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 399, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
raise value.with_traceback(tb)
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1268, in fetchone
row = self._fetchone_impl()
File "/home/quh/.conda/envs/pytorch/lib/python3.7/site-packages/sqlalchemy/engine/result.py", line 1148, in _fetchone_impl
return self.cursor.fetchone()
sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) Cannot operate on a closed database.
(Background on this error at: http://sqlalche.me/e/f405)

@jasonLvChina
Copy link

I solved this problem by "pip install records==0.5.2"
but got another problem...

@quuhua911
Copy link
Author

Thanks so much!

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

No branches or pull requests

2 participants