Skip to content

Commit

Permalink
Update module example (apache#12961)
Browse files Browse the repository at this point in the history
* Update Module example

* trigger CI
  • Loading branch information
ThomasDelteil authored and Jose Luis Contreras committed Nov 13, 2018
1 parent e7bd066 commit d24783b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import os
import mxnet as mx
import zipfile

def get_mnist(data_dir):
if not os.path.isdir(data_dir):
Expand All @@ -28,7 +29,7 @@ def get_mnist(data_dir):
(not os.path.exists('t10k-labels-idx1-ubyte')):
import urllib, zipfile
zippath = os.path.join(os.getcwd(), "mnist.zip")
urllib.urlretrieve("http://data.mxnet.io/mxnet/data/mnist.zip", zippath)
mx.test_utils.download("http://data.mxnet.io/mxnet/data/mnist.zip", zippath)
zf = zipfile.ZipFile(zippath, "r")
zf.extractall()
zf.close()
Expand All @@ -45,7 +46,7 @@ def get_cifar10(data_dir):
import urllib, zipfile, glob
dirname = os.getcwd()
zippath = os.path.join(dirname, "cifar10.zip")
urllib.urlretrieve("http://data.mxnet.io/mxnet/data/cifar10.zip", zippath)
mx.test_utils.download("http://data.mxnet.io/mxnet/data/cifar10.zip", zippath)
zf = zipfile.ZipFile(zippath, "r")
zf.extractall()
zf.close()
Expand All @@ -56,7 +57,6 @@ def get_cifar10(data_dir):
os.rmdir(os.path.join(dirname, "cifar"))
os.chdir(cwd)

# data
def get_cifar10_iterator(args, kv):
data_shape = (3, 28, 28)
data_dir = args.data_dir
Expand Down

0 comments on commit d24783b

Please # to comment.