tapas: Error when create_data is used on WIKISQL
I’m trying to replicate the results (to ensure I’m setting everything up properly) using the WikiSQL dataset. I am using “tapas_wikisql_sqa_masklm_small_reset.zip” model. However when I try running:
!python tapas/tapas/run_task_main.py \
--task="WIKISQL" \
--input_dir="data/" \
--output_dir="results/wsql/input_data" \
--bert_vocab_file="tapas_model/bert_config.json" \
--mode="create_data"
I encounter the following error:
I1005 02:55:27.819439 139825599944576 sqa_utils.py:102] Total Valid Failed File
56355 55775 580 train.tsv
8421 8421 0 dev.tsv
15878 15878 0 test.tsv
Creating TF examples ...
I1005 02:55:36.143442 139825599944576 run_task_main.py:152] Creating TF examples ...
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tapas/scripts/prediction_utils.py:48: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and:
`tf.data.TFRecordDataset(path)`
W1005 02:55:36.144381 139825599944576 deprecation.py:323] From /usr/local/lib/python3.6/dist-packages/tapas/scripts/prediction_utils.py:48: tf_record_iterator (from tensorflow.python.lib.io.tf_record) is deprecated and will be removed in a future version.
Instructions for updating:
Use eager execution and:
`tf.data.TFRecordDataset(path)`
I1005 02:55:36.159258 139825599944576 number_annotation_utils.py:149] Can't consolidate types: (None, text: "Current slogan"
) {0: [float_value: 2013.0
, date {
year: 2013
}
], 1: [], 2: [], 3: [], 4: [], 5: [], 6: []} 1
Traceback (most recent call last):
File "tapas/tapas/run_task_main.py", line 782, in <module>
app.run(main)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "tapas/tapas/run_task_main.py", line 743, in main
output_dir=output_dir)
File "tapas/tapas/run_task_main.py", line 178, in _create_all_examples
test_mode=test_mode)
File "tapas/tapas/run_task_main.py", line 231, in _create_examples
examples.append(converter.convert(interaction, i))
File "/usr/local/lib/python3.6/dist-packages/tapas/utils/tf_example_utils.py", line 1096, in convert
drop_rows_to_fit=self._drop_rows_to_fit)
File "/usr/local/lib/python3.6/dist-packages/tapas/utils/tf_example_utils.py", line 1018, in _to_trimmed_features
serialized_example.tokens, feature_dict, table=table, question=question)
File "/usr/local/lib/python3.6/dist-packages/tapas/utils/tf_example_utils.py", line 673, in _to_features
input_ids = self._to_token_ids(tokens)
File "/usr/local/lib/python3.6/dist-packages/tapas/utils/tf_example_utils.py", line 656, in _to_token_ids
return self._tokenizer.convert_tokens_to_ids(_get_pieces(tokens))
File "/usr/local/lib/python3.6/dist-packages/tapas/utils/tf_example_utils.py", line 332, in convert_tokens_to_ids
return self._wp_tokenizer.convert_tokens_to_ids(word_pieces)
File "/usr/local/lib/python3.6/dist-packages/official/nlp/bert/tokenization.py", line 190, in convert_tokens_to_ids
return convert_by_vocab(self.vocab, tokens)
File "/usr/local/lib/python3.6/dist-packages/official/nlp/bert/tokenization.py", line 150, in convert_by_vocab
output.append(vocab[item])
KeyError: '[CLS]'
Is this an issue with the WikiSQL data itself, or is it the .py utility within TAPAS?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 41
@alxblandin yes agreed, I’ll get back at it in a bit here. Please ping me if you manage to crack the nut!
@alxblandin, any luck with your predict_evaluate? So far a lot of sleeping for me:
UPDATE: My issue was I didn’t have the model checkpoint in the right directory. So it was basically sitting and looking for a model every 5 mins. Once I moved the checkpoint in the right folder, it worked.