google-research / bert

TensorFlow code and pre-trained models for BERT
https://arxiv.org/abs/1810.04805
Apache License 2.0
38.21k stars 9.61k forks source link

run_classifier error with CoLA dataset #144

Open jwnsu opened 6 years ago

jwnsu commented 6 years ago

Default MRPC runs fine, change task name to CoLA, got following error with run_classifier:

Traceback (most recent call last):
  File "run_classifier.py", line 917, in <module>
    tf.app.run()
  File "/home/tf3/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "run_classifier.py", line 830, in main
    train_examples, label_list, FLAGS.max_seq_length, tokenizer, train_file)
  File "run_classifier.py", line 466, in file_based_convert_examples_to_features
    max_seq_length, tokenizer)
  File "run_classifier.py", line 432, in convert_single_example
    label_id = label_map[example.label]
KeyError: '#1 ID'

Anyone has seen this error? Thx.

monanahe commented 5 years ago

The return of ColaProcessor.get_labels should match your own dataset's labels. Also, the format of your dataset seems not meet the demand format.

jwnsu commented 5 years ago

CoLA is one of 4 supported datasets/tasks coming in original codes, not my own dataset. The dataset was also downloaded by following instruction in readme.md.

KoLemonCN commented 5 years ago

try to pull from the git and rerun your app again.