foamliu / Car-Recognition

Car Recognition with Deep Learning
MIT License
343 stars 135 forks source link

Testing accuracy #23

Open baselmousi opened 4 years ago

baselmousi commented 4 years ago

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'
Lin-plax commented 4 years ago

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?

Usman-Ghani123 commented 4 years ago

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

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