07_Milestone project predictions #148
-
Hello, could you help me please. When i make predictions on all test data and then compare it to the labels, i don't get any coincidences (accuracy on test data is 75%)
Result
And if i do prediction on single image, i get pretty good result
I guess the problem is in the way i unbatch test data. I had no problems, when data was preprocessed with image_dataset_from_directory |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Hey @Natali-bali I assume that your working on FoodVision Milestone Project, if that's the case, here's the reason you're facing that issue. Initially, when we import the dataset from Tensorflow Datasets Module we shuffle it. So every time you try to access SolutionYou can simply get rid of shuffling in |
Beta Was this translation helpful? Give feedback.
-
Thanks man, this really solved my Accuracy score which so low like |
Beta Was this translation helpful? Give feedback.
Hey @Natali-bali
I assume that your working on FoodVision Milestone Project, if that's the case, here's the reason you're facing that issue.
Initially, when we import the dataset from Tensorflow Datasets Module we shuffle it. So every time you try to access
test_data
variable it gets shuffled. Hence why, your models predictions and the ground-truth values don't match.Solution
You can simply get rid of shuffling in
test_data
by settingshuffle=False
(only fortest_data
), and it wont affect the model's accuracy.