diff options
author | Martin Wicke <wicke@google.com> | 2016-06-03 14:23:52 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-06-03 15:28:30 -0700 |
commit | 60796d7c0d401e5e7b7a139f165e78ce778583be (patch) | |
tree | 2ccef0ac177be5e467e403ccc4e18cb195f4ef90 /tensorflow/examples/udacity | |
parent | 349072f401952f0aba5240160b1ad6bf9a64bf17 (diff) |
Merge changes from github.
Change: 124012080
Diffstat (limited to 'tensorflow/examples/udacity')
-rw-r--r-- | tensorflow/examples/udacity/1_notmnist.ipynb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/examples/udacity/1_notmnist.ipynb b/tensorflow/examples/udacity/1_notmnist.ipynb index 32ece419b0..01c6231ab4 100644 --- a/tensorflow/examples/udacity/1_notmnist.ipynb +++ b/tensorflow/examples/udacity/1_notmnist.ipynb @@ -319,18 +319,19 @@ " dataset = np.ndarray(shape=(len(image_files), image_size, image_size),\n", " dtype=np.float32)\n", " print(folder)\n", - " for image_index, image in enumerate(image_files):\n", + " num_images = 0\n", + " for image in image_files:\n", " image_file = os.path.join(folder, image)\n", " try:\n", " image_data = (ndimage.imread(image_file).astype(float) - \n", " pixel_depth / 2) / pixel_depth\n", " if image_data.shape != (image_size, image_size):\n", " raise Exception('Unexpected image shape: %s' % str(image_data.shape))\n", - " dataset[image_index, :, :] = image_data\n", + " dataset[num_images, :, :] = image_data\n", + " num_images = num_images + 1\n", " except IOError as e:\n", " print('Could not read:', image_file, ':', e, '- it\\'s ok, skipping.')\n", " \n", - " num_images = image_index + 1\n", " dataset = dataset[0:num_images, :, :]\n", " if num_images < min_num_images:\n", " raise Exception('Many fewer images than expected: %d < %d' %\n", |