diff --git a/image-classification/dlnd_image_classification.ipynb b/image-classification/dlnd_image_classification.ipynb index 4828a51381..a0698b809c 100644 --- a/image-classification/dlnd_image_classification.ipynb +++ b/image-classification/dlnd_image_classification.ipynb @@ -765,7 +765,7 @@ " Test the saved model against the test dataset\n", " \"\"\"\n", "\n", - " test_features, test_labels = pickle.load(open('preprocess_training.p', mode='rb'))\n", + " test_features, test_labels = pickle.load(open('preprocess_test.p', mode='rb'))\n", " loaded_graph = tf.Graph()\n", "\n", " with tf.Session(graph=loaded_graph) as sess:\n", @@ -784,10 +784,10 @@ " test_batch_acc_total = 0\n", " test_batch_count = 0\n", " \n", - " for train_feature_batch, train_label_batch in helper.batch_features_labels(test_features, test_labels, batch_size):\n", + " for test_feature_batch, test_label_batch in helper.batch_features_labels(test_features, test_labels, batch_size):\n", " test_batch_acc_total += sess.run(\n", " loaded_acc,\n", - " feed_dict={loaded_x: train_feature_batch, loaded_y: train_label_batch, loaded_keep_prob: 1.0})\n", + " feed_dict={loaded_x: test_feature_batch, loaded_y: test_label_batch, loaded_keep_prob: 1.0})\n", " test_batch_count += 1\n", "\n", " print('Testing Accuracy: {}\\n'.format(test_batch_acc_total/test_batch_count))\n", diff --git a/image-classification/helper.py b/image-classification/helper.py index 71c8025d6d..40b69c95dc 100644 --- a/image-classification/helper.py +++ b/image-classification/helper.py @@ -102,17 +102,17 @@ def preprocess_and_save_data(cifar10_dataset_folder_path, normalize, one_hot_enc with open(cifar10_dataset_folder_path + '/test_batch', mode='rb') as file: batch = pickle.load(file, encoding='latin1') - # load the training data + # load the test data test_features = batch['data'].reshape((len(batch['data']), 3, 32, 32)).transpose(0, 2, 3, 1) test_labels = batch['labels'] - # Preprocess and Save all training data + # Preprocess and Save all test data _preprocess_and_save( normalize, one_hot_encode, np.array(test_features), np.array(test_labels), - 'preprocess_training.p') + 'preprocess_test.p') def batch_features_labels(features, labels, batch_size):