Car-Recognition icon indicating copy to clipboard operation
Car-Recognition copied to clipboard

Testing accuracy

Open baselmousi opened this issue 5 years ago • 2 comments

How can we find the testing accuracy? I ran the following code y_pred, y_test = predict('/content/gdrive/My Drive/Car-Recognition/data/test', model) acc = calc_acc(y_pred, y_test) print("%s: %.2f%%" % ('acc', acc * 100)) where I stored my test data at '/content/gdrive/My Drive/Car-Recognition/data/test' but I got the following error ValueError Traceback (most recent call last) in () 9 10 ---> 11 y_pred, y_test = predict('/content/gdrive/My Drive/Car-Recognition/data/test', model) 12 acc = calc_acc(y_pred, y_test) 13 print("%s: %.2f%%" % ('acc', acc * 100))

in predict(img_dir, model) 19 y_pred.append(pred_label) 20 tokens = img_path.split(os.path.sep) ---> 21 class_id = int(tokens[-2]) 22 # print(str(class_id)) 23 y_test.append(class_id)

ValueError: invalid literal for int() with base 10: 'test'

baselmousi avatar Jun 08 '20 20:06 baselmousi

How can we find the testing accuracy? I ran the following code y_pred, y_test = predict('/content/gdrive/My Drive/Car-Recognition/data/test', model) acc = calc_acc(y_pred, y_test) print("%s: %.2f%%" % ('acc', acc * 100)) where I stored my test data at '/content/gdrive/My Drive/Car-Recognition/data/test' but I got the following error ValueError Traceback (most recent call last) in () 9 10 ---> 11 y_pred, y_test = predict('/content/gdrive/My Drive/Car-Recognition/data/test', model) 12 acc = calc_acc(y_pred, y_test) 13 print("%s: %.2f%%" % ('acc', acc * 100))

in predict(img_dir, model) 19 y_pred.append(pred_label) 20 tokens = img_path.split(os.path.sep) ---> 21 class_id = int(tokens[-2]) 22 # print(str(class_id)) 23 y_test.append(class_id)

ValueError: invalid literal for int() with base 10: 'test'

Can you run the train.py?

Lin-plax avatar Aug 06 '20 12:08 Lin-plax

You can check test accuracy thorugh online evaluation. There is a link given on the github.

Get Outlook for Androidhttps://aka.ms/ghei36

Usman-Ghani123 avatar Aug 11 '20 21:08 Usman-Ghani123