multiNLI icon indicating copy to clipboard operation
multiNLI copied to clipboard

Array index out of bound when testing

Open PaulCCCCCCH opened this issue 6 years ago • 1 comments

In python/train_snli.py , line 246 The code gives index out of bound error, because results is a tuple with 2 elements.

     results = evaluate_final(classifier.restore, classifier.classify, [test_matched, test_mismatched,     test_snli], FIXED_PARAMETERS["batch_size"])
     logger.Log("Acc on multiNLI matched dev-set: %s" %(results[0]))
     logger.Log("Acc on multiNLI mismatched dev-set: %s" %(results[1]))
     logger.Log("Acc on SNLI test set: %s" %(results[2]))

I guess what you mean is the following:

     results = evaluate_final(classifier.restore, classifier.classify, [test_matched, test_mismatched,     test_snli], FIXED_PARAMETERS["batch_size"])
     logger.Log("Acc on multiNLI matched dev-set: %s" %(results[0][0]))
     logger.Log("Acc on multiNLI mismatched dev-set: %s" %(results[0][1]))
     logger.Log("Acc on SNLI test set: %s" %(results[0][2]))
     logger.Log(" correct count | total by length: %s" %(results[1]))

I changed it and it works fine on my machine. Thanks.

PaulCCCCCCH avatar Feb 20 '19 10:02 PaulCCCCCCH

I get same error for train_mnli.py also. However, my issue was that I had to uncomment some lines which replaced test files with dev files (lines 300-303) and some other changes. You can use my fork if anyone wants to run tests.

mithunpaul08 avatar Nov 10 '19 09:11 mithunpaul08