bert icon indicating copy to clipboard operation
bert copied to clipboard

run_classifier error with CoLA dataset

Open jwnsu opened this issue 8 years ago • 3 comments

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.

jwnsu avatar Nov 19 '18 22:11 jwnsu

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.

monanahe avatar Nov 21 '18 07:11 monanahe

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.

jwnsu avatar Nov 21 '18 15:11 jwnsu

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

KoLemonCN avatar Nov 27 '18 11:11 KoLemonCN