naver/sqlova

Error when testing

Opened this issue · 10 comments

I run the command in Readme.md. And after a long time of running, an error is thrown:

Traceback (most recent call last):
  File "train.py", line 614, in <module>
    dset_name='dev', EG=args.EG)
  File "train.py", line 495, in test
    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/sqlova-master/sqlova/utils/utils_wikisql.py", line 1651, 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/sqlova-master/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','')
IndexError: list index out of range

Is it because no result is received? Do you have any idea to solve this issue? Thank you in advance!

Hi @rylanchiu

Which version of records are you using? The issue seems to be related with the version of this module. Check this.

The sqlova has tested with records=0.5.2

Thanks!

Wonseok

@whwang299 Thanks for your reply. I have already downgraded it to 0.5.2 but the issue still exists.

@rylanchiu I have downloaded & tested my code again but could't reproduce the error... Another possible cause could be the mismatch between (question, SQL)-data and corresponding table-data (e.g. using dev.table.jsonl for train_tok.jsonl). If this is not the case, I recommend you to measure only logical form accuracy .. as a temporary solution.

Wonseok

@rylanchiu, I'm getting the same error. Any fixes that you can share?

@jaurment , @rylanchiu Could you print and upload
tb[b], g_sc[b], g_sa[b], g_sql_i, nlu_q[b] and corresponding nlu[b]?

It seems to break on the first example

tb[b]['id']: 2-13758945-2
g_sc[b]: 3
g_sa[b]: 0
g_sql_i[b]: {'sel': 3, 'conds': [[4, 0, '528']], 'agg': 0}

which corresponds to the nlu -- 'What lost has 528 as the points?'

Let me know if this helps or if you need more information. Can copy all of tb[b] if you need it

I'm getting the same error. Any fixes that you can share?qwq

I faced same issue but it got resolved after downgrading records to 0.5.2

I'm getting the same error. Any fixes that you can share?

Did you try downgrading records package to 0.5.2?