This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Can't run example code with Python 3 #3995
Comments
Thanks for bringing the py3 incompatibility to our attention. I'd also like to make sure everything workings with py3, and can take a look at this issue later in the week. |
this should be already fixed by #3999 |
~/work/mxnet/example/image-classification/train_mnist.py works now :) Still, there are more scripts with print operators. |
This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Python example code can't be run, as they are written with Python 2.
Steps to reproduce: just run with Python 3
{ image-classification } » python3 train_mnist.py
2016-11-27 01:37:30,367 Node[0] start with arguments Namespace(batch_size=128, data_dir='mnist/', gpus=None, kv_store='local', load_epoch=None, lr=0.1, lr_factor=1, lr_factor_epoch=1, model_prefix=None, network='mlp', num_epochs=10, num_examples=60000, save_model_prefix=None)
Traceback (most recent call last):
File "train_mnist.py", line 161, in
train_model.fit(args, net, get_iterator(data_shape))
File "D:\work\tmp\mxnet-master\example\image-classification\train_model.py", line 51, in fit
(train, val) = data_loader(args, kv)
File "train_mnist.py", line 89, in get_iterator_impl
_download(data_dir)
File "train_mnist.py", line 17, in _download
urllib.urlretrieve("http://data.mxnet.io/mxnet/data/mnist.zip", zippath)
AttributeError: module 'urllib' has no attribute 'urlretrieve'
This is because Python 3 no longer has urllib.
http://stackoverflow.com/questions/17960942/attributeerror-module-object-has-no-attribute-urlretrieve
please, migrate to Python 3! It is painful to have 2 and 3 on the system, especially on Windows.
The text was updated successfully, but these errors were encountered: