Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fixing tutorials. (#6436)
Browse files Browse the repository at this point in the history
Most of the fixes should be self evident. For tutorial on pre-trained models, one of the images doesn't exist anymore so selected a new one. Long-term, we should put such images on web-data repo but alas, some other day.

For Handwritten digit tutorial, we are missing couple of imports in the test_utils.py that was recently created.

Note that: for pre-trained model tutorial, we get a softmax_label warning and the probability scores are not really probabilities. Will deal with that issue in another PR.

Testing:
I've tried to test all the notebooks with this change and things look fine.
  • Loading branch information
pracheer authored and piiswrong committed May 25, 2017
1 parent 82efa6a commit 624b2d1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/basic/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Download and unzip
```python
fname = mx.test_utils.download(url='http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz', dirname='data', overwrite=False)
tar = tarfile.open(fname)
tar.extracall()
tar.extractall()
tar.close()
os.chdir('../')
```
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/basic/ndarray.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ shapes must be the same along the other axes.
```python
a = mx.nd.ones((2,3))
b = mx.nd.ones((2,3))*2
c = mx.nd.concat([a,b])
c = mx.nd.concat(a,b)
c.asnumpy()
```

Expand Down Expand Up @@ -358,7 +358,7 @@ The `load` and `save` methods are preferable to pickle in two respects

```python
a = mx.nd.ones((2, 3))
mx.save("temp.ndarray", [a,])
mx.nd.save("temp.ndarray", [a,])
```

we can later load it from R:
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/basic/symbol.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ data = mx.sym.Variable("data")
net = data
n_layer = 2
for i in range(n_layer):
with mx.name.Prefix("layer%d_" % (i + 1)):
net = mx.sym.FullyConnected(data=net, name="fc", num_hidden=100)
with mx.name.Prefix("layer%d_" % (i + 1)):
net = mx.sym.FullyConnected(data=net, name="fc", num_hidden=100)
net.list_arguments()
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/python/predict_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ predict('http://writm.com/wp-content/uploads/2016/08/Cat-hd-wallpapers.jpg')
```

```python
predict('http://images-na.ssl-images-amazon.com/images/G/01/img15/pet-products/small-tiles/23695_pets_vertical_store_dogs_small_tile_8._CB312176604_.jpg')
predict('http://thenotoriouspug.com/wp-content/uploads/2015/01/Pug-Cookie-1920x1080-1024x576.jpg')
```

## Feature extraction
Expand Down
2 changes: 2 additions & 0 deletions python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# pylint: disable=too-many-lines
from __future__ import absolute_import, print_function, division
import time
import gzip
import struct
import traceback
import numbers
import subprocess
Expand Down

0 comments on commit 624b2d1

Please sign in to comment.