salesforce / TabularSemanticParsing

Translating natural language questions to a structured query language
https://arxiv.org/abs/2012.12627
BSD 3-Clause "New" or "Revised" License
221 stars 52 forks source link

ValueError when running inference #14

Open yaoyiyao-yao opened 3 years ago

yaoyiyao-yao commented 3 years ago

Hi, I have two problems.

First,in Process Spider Data part,"mv spider data/ "can not execute,I think it is because "data/spider/scripts" already exists.Does it mean add scripts folder under spider folder and then put spider folder under data folder?

Second,in inference part,after using "./experiment-bridge.sh configs/bridge/spider-bridge-bert-large.sh --inference 0 --checkpoint_path /home/guest31/spiderModel/TabularSemanticParsing/model/bridge-spider-bert-large-ems-70-1-exe-68-2.tar",the output shows ”ValueError: too many values to unpack (expected 3)" The details are as follows: Traceback (most recent call last): File "/home/guest31/anaconda3/envs/bridge/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/guest31/anaconda3/envs/bridge/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/guest31/spiderModel/TabularSemanticParsing/src/experiments.py", line 407, in run_experiment(args) File "/home/guest31/spiderModel/TabularSemanticParsing/src/experiments.py", line 394, in run_experiment inference(sp) File "/home/guest31/spiderModel/TabularSemanticParsing/src/experiments.py", line 122, in inference engine=engine, inline_eval=True, verbose=True) File "/home/guest31/spiderModel/TabularSemanticParsing/src/semantic_parser/learn_framework.py", line 209, in inference restored_pred, grammatical, schema_consistent = pred_restored_cache[db_name][pred_sql] ValueError: too many values to unpack (expected 3)

Could you please give me some suggestions? Thank you.

thecodemakr commented 3 years ago

I have not been able to run this end to end but I moved this checkpoint to the default location. I did not get value errors then.

mv bridge-spider-bert-large-ems-70-1-exe-68-2.tar /content/TabularSemanticParsing/model/spider.bridge.lstm.meta.ts.ppl-0.85.2.dn.eo.feat.bert-large-uncased.xavier-1024-400-400-16-2-0.0005-inv-sqr-0.0005-4000-6e-05-inv-sqr-3e-05-4000-0.3-0.3-0.0-0.0-1-8-0.0-0.0-res-0.2-0.0-ff-0.4-0.0/model-best.tar
yaoyiyao-yao commented 3 years ago

Thanks for your suggestion. But after I trying this,I still have the "ValueError: too many values to unpack (expected 3)" problem.

1160300911 commented 3 years ago

I think this is because the uploaded cache file was saved by the previous version of the code. In the previous version, this line was written as followed:

restored_pred = pred_restored_cache[db_name][pred_sql]

So you need to restore this line. And due to the completeness, you also need to restore the moz_sp.restore_clause_order function as before.

CannonWWW commented 7 months ago

I think this is because the uploaded cache file was saved by the previous version of the code. In the previous version, this line was written as followed:

restored_pred = pred_restored_cache[db_name][pred_sql]

So you need to restore this line. And due to the completeness, you also need to restore the moz_sp.restore_clause_order function as before.

could you please tell how to fix the bug? I would greatly appreciate your urgent assistance with this matter.