cs230-stanford / cs230-code-examples

Code examples in pyTorch and Tensorflow for CS230
Other
3.9k stars 996 forks source link

OutOfRangeError if test set larger than dev set #14

Open kldtz opened 6 years ago

kldtz commented 6 years ago

There is a little issue in cs230-code-examples/tensorflow/nlp/evaluate.py: You use the dev set for evaluation:

path_eval_sentences = os.path.join(args.data_dir, 'dev/sentences.txt')
path_eval_labels = os.path.join(args.data_dir, 'dev/labels.txt')

But later you iterate over the size of the test set:

params.eval_size = params.test_size

If the test set is larger than the dev set, this leads to an OutOfRangeError. If the test set is smaller than the dev set, the iteration stops too early.

Thanks for sharing the code!