Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Error on Sentence Classification example #80

Closed
xikunlun001 opened this issue Nov 8, 2018 · 8 comments
Closed

Key Error on Sentence Classification example #80

xikunlun001 opened this issue Nov 8, 2018 · 8 comments

Comments

@xikunlun001
Copy link

I was trying to run the sentence classification example step by step but there is a keyerror happened at very beginning as following:

INFO:tensorflow:Writing example 0 of 3669
Traceback (most recent call last):
File "run_classifier.py", line 908, in
tf.app.run()
File "/home/guyang/anaconda2/envs/BERT/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "run_classifier.py", line 824, in main
train_examples, label_list, FLAGS.max_seq_length, tokenizer, train_file)
File "run_classifier.py", line 458, in file_based_convert_examples_to_features
max_seq_length, tokenizer)
File "run_classifier.py", line 428, in convert_single_example
label_id = label_map[example.label]
KeyError: '\ufeffQuality'

@jacobdevlin-google
Copy link
Contributor

Oops, I introduced a bug this morning. I just fixed it now.

@xikunlun001
Copy link
Author

@jacobdevlin-google thanks

@PaulZhangIsing
Copy link

@jacobdevlin-google thanks

so how did u solve it in the end??

@PaulZhangIsing
Copy link

Oops, I introduced a bug this morning. I just fixed it now.

I have pulled the lastest version (i.e. 21 days ago with self-written processors,)seems this kind of error happens again

@PaulZhangIsing
Copy link

PaulZhangIsing commented Jan 9, 2019

Seems there is some bug on line 489 of run_classifier.py.
I added a tab before features and everything is fine

@Danysolism
Copy link

I've tried adding the tab at line 489 but it doesn't fix the error, any suggestions? thanks :)

@PaulZhangIsing
Copy link

well, this tab does not help. could u show your data and data processor??

I've tried adding the tab at line 489 but it doesn't fix the error, any suggestions? thanks :)

@delgadoliveira
Copy link

You need to hide the row index from your data frame in time of saving to tsv. It could be df.to_csv('train.tsv', sep='\t', index=False, header=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants