use python to download and unzip files instead of wget, unzip command#2325
use python to download and unzip files instead of wget, unzip command#2325CharlesMei wants to merge 1 commit intoapache:masterfrom
Conversation
| elif sys.version_info.major == 3: | ||
| from urllib.request import urlretrieve | ||
| urlretrieve(url, 'cifar10.zip') | ||
| import zipfile |
There was a problem hiding this comment.
is zipfile available by default?
There was a problem hiding this comment.
Yes, zipfile is in python standard library.
There was a problem hiding this comment.
confirmed. It works on Python 2.7.10 and 3.5.1
On Sat, Jun 4, 2016 at 2:53 AM, CharlesMei notifications@github.com wrote:
In example/image-classification/train_cifar10.py
#2325 (comment):os.chdir(data_dir) if (not os.path.exists('train.rec')) or \ (not os.path.exists('test.rec')) :
os.system("wget http://webdocs.cs.ualberta.ca/~bx3/data/cifar10.zip")os.system("unzip -u cifar10.zip")os.system("mv cifar/\* .; rm -rf cifar; rm cifar10.zip")url = 'http://webdocs.cs.ualberta.ca/~bx3/data/cifar10.zip'if sys.version_info.major == 2:from urllib import urlretrieveelif sys.version_info.major == 3:from urllib.request import urlretrieveurlretrieve(url, 'cifar10.zip')import zipfileYes, zipfile is in python standard library.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dmlc/mxnet/pull/2325/files/ce5b4b9f8f789db8cb6799de341726d60ce3caa1#r65758312,
or mute the thread
https://github.com/notifications/unsubscribe/ABFI4WfsBu9cFwBt8TuOMteeMFXLep6wks5qIHhBgaJpZM4ItTgY
.
HONG Chuntao
System Research Group
Microsoft Research Asia
|
@hjk41 Could you verify thsi? |
|
LGTM. Please rebase and merge |
|
There seems to be a lot of new changes. Could you explain them? @thirdwing Seems to be about R package |
|
It is from #2329 All the commits in that PR have been squashed into one commit. |
|
I'm sorry, i'm not familiar with git to do this. I think i may need to learn more about git. Can you help me? |
|
try |
|
another simpler way might be simply keep your changes and start from a clean fork |
|
@piiswrong, thank you , but because of my former mistakes, my master has changed, i'm afraid there may be something wrong to just do this now. |
|
@tqchen do you mean remove my master branch, and rebase my dev on upstream |
|
@CharlesMei Try the method here http://eli.thegreenplace.net/2014/02/19/squashing-github-pull-requests-into-a-single-commit . You can, for example, use |
|
@CharlesMei You need to update the submodules. |
this fixes #2237 #1559, for windows user, it is not convenient to use wget, mkdir, unzip like linux user.
we can use pure python code to download and unzip dataset, which works for both windows, linux/unix.