|
58 | 58 | }, |
59 | 59 | { |
60 | 60 | "cell_type": "code", |
61 | | - "execution_count": 6, |
| 61 | + "execution_count": 1, |
62 | 62 | "metadata": { |
63 | 63 | "collapsed": true |
64 | 64 | }, |
|
94 | 94 | }, |
95 | 95 | { |
96 | 96 | "cell_type": "code", |
97 | | - "execution_count": 7, |
| 97 | + "execution_count": 2, |
98 | 98 | "metadata": { |
99 | 99 | "collapsed": true |
100 | 100 | }, |
|
114 | 114 | }, |
115 | 115 | { |
116 | 116 | "cell_type": "code", |
117 | | - "execution_count": 8, |
| 117 | + "execution_count": 3, |
118 | 118 | "metadata": { |
119 | 119 | "collapsed": true |
120 | 120 | }, |
|
158 | 158 | }, |
159 | 159 | { |
160 | 160 | "cell_type": "code", |
161 | | - "execution_count": 9, |
| 161 | + "execution_count": 4, |
162 | 162 | "metadata": {}, |
163 | | - "outputs": [], |
| 163 | + "outputs": [ |
| 164 | + { |
| 165 | + "ename": "IOError", |
| 166 | + "evalue": "[Errno 2] No such file or directory: 'data/train-images-idx3-ubyte'", |
| 167 | + "output_type": "error", |
| 168 | + "traceback": [ |
| 169 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 170 | + "\u001b[0;31mIOError\u001b[0m Traceback (most recent call last)", |
| 171 | + "\u001b[0;32m<ipython-input-4-3016031659c9>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m train_img, train_lbl = loadmnist('data/train-images-idx3-ubyte'\n\u001b[0;32m----> 2\u001b[0;31m , 'data/train-labels-idx1-ubyte')\n\u001b[0m\u001b[1;32m 3\u001b[0m test_img, test_lbl = loadmnist('data/t10k-images-idx3-ubyte'\n\u001b[1;32m 4\u001b[0m , 'data/t10k-labels-idx1-ubyte')\n", |
| 172 | + "\u001b[0;32m<ipython-input-3-d872c2c49a73>\u001b[0m in \u001b[0;36mloadmnist\u001b[0;34m(imagefile, labelfile)\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# Open the images with gzip in read binary mode\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mimages\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimagefile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mlabels\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlabelfile\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", |
| 173 | + "\u001b[0;31mIOError\u001b[0m: [Errno 2] No such file or directory: 'data/train-images-idx3-ubyte'" |
| 174 | + ] |
| 175 | + } |
| 176 | + ], |
164 | 177 | "source": [ |
165 | 178 | "train_img, train_lbl = loadmnist('data/train-images-idx3-ubyte'\n", |
166 | 179 | " , 'data/train-labels-idx1-ubyte')\n", |
|
170 | 183 | }, |
171 | 184 | { |
172 | 185 | "cell_type": "code", |
173 | | - "execution_count": 10, |
| 186 | + "execution_count": null, |
174 | 187 | "metadata": {}, |
175 | | - "outputs": [ |
176 | | - { |
177 | | - "name": "stdout", |
178 | | - "output_type": "stream", |
179 | | - "text": [ |
180 | | - "(60000, 784)\n" |
181 | | - ] |
182 | | - } |
183 | | - ], |
| 188 | + "outputs": [], |
184 | 189 | "source": [ |
185 | 190 | "print(train_img.shape)" |
186 | 191 | ] |
187 | 192 | }, |
188 | 193 | { |
189 | 194 | "cell_type": "code", |
190 | | - "execution_count": 11, |
| 195 | + "execution_count": 5, |
191 | 196 | "metadata": {}, |
192 | 197 | "outputs": [ |
193 | 198 | { |
194 | | - "name": "stdout", |
195 | | - "output_type": "stream", |
196 | | - "text": [ |
197 | | - "(60000,)\n" |
| 199 | + "ename": "NameError", |
| 200 | + "evalue": "name 'train_lbl' is not defined", |
| 201 | + "output_type": "error", |
| 202 | + "traceback": [ |
| 203 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 204 | + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
| 205 | + "\u001b[0;32m<ipython-input-5-b14c321fab44>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrain_lbl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
| 206 | + "\u001b[0;31mNameError\u001b[0m: name 'train_lbl' is not defined" |
198 | 207 | ] |
199 | 208 | } |
200 | 209 | ], |
|
204 | 213 | }, |
205 | 214 | { |
206 | 215 | "cell_type": "code", |
207 | | - "execution_count": 12, |
| 216 | + "execution_count": 6, |
208 | 217 | "metadata": {}, |
209 | 218 | "outputs": [ |
210 | 219 | { |
211 | | - "name": "stdout", |
212 | | - "output_type": "stream", |
213 | | - "text": [ |
214 | | - "(10000, 784)\n" |
| 220 | + "ename": "NameError", |
| 221 | + "evalue": "name 'test_img' is not defined", |
| 222 | + "output_type": "error", |
| 223 | + "traceback": [ |
| 224 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 225 | + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
| 226 | + "\u001b[0;32m<ipython-input-6-dfe1f893088e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtest_img\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
| 227 | + "\u001b[0;31mNameError\u001b[0m: name 'test_img' is not defined" |
215 | 228 | ] |
216 | 229 | } |
217 | 230 | ], |
|
221 | 234 | }, |
222 | 235 | { |
223 | 236 | "cell_type": "code", |
224 | | - "execution_count": 13, |
| 237 | + "execution_count": 7, |
225 | 238 | "metadata": {}, |
226 | 239 | "outputs": [ |
227 | 240 | { |
228 | | - "name": "stdout", |
229 | | - "output_type": "stream", |
230 | | - "text": [ |
231 | | - "(10000,)\n" |
| 241 | + "ename": "NameError", |
| 242 | + "evalue": "name 'test_lbl' is not defined", |
| 243 | + "output_type": "error", |
| 244 | + "traceback": [ |
| 245 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 246 | + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
| 247 | + "\u001b[0;32m<ipython-input-7-9666b7c1db35>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtest_lbl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
| 248 | + "\u001b[0;31mNameError\u001b[0m: name 'test_lbl' is not defined" |
232 | 249 | ] |
233 | 250 | } |
234 | 251 | ], |
|
0 commit comments