Hiroshi Chin
Hiroshi Chin

Reputation: 11

fail to install mxnet in ios (El Capitan) and run python (2.7) examples

I have tried to run install Mxnet deeplearning framework but I failed because of the following error when I tried to run the python example, and I could not find the best treatment in the web.

MacBook-Pro-4:mxnet chinhiroshi$ python example/image-classification/train_mnist.py
2016-03-22 11:51:59,386 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)
Traceback (most recent call last):
  File "example/image-classification/train_mnist.py", line 130, in <module>
    train_model.fit(args, net, get_iterator(data_shape))
  File "/Users/chinhiroshi/Dropbox/code/python/package/mxnet/example/image-classification/train_model.py", line 41, in fit
    save_model_prefix = args.save_model_prefix
AttributeError: 'Namespace' object has no attribute 'save_model_prefix'

Upvotes: 1

Views: 128

Answers (1)

Ishamael
Ishamael

Reputation: 12795

The save_model_prefix was introduced just 15 days ago. You most likely installed mxnet before that, and therefore have a version that doesn't support it.

You can either reinstall latest mxnet from source, or fix the problem in the example itself. For that open train_model.py (see the full path in your backtrace), and change the following four lines:

save_model_prefix = args.save_model_prefix
if save_model_prefix is None:
    save_model_prefix = model_prefix
checkpoint = None if save_model_prefix is None else mx.callback.do_checkpoint(save_model_prefix)

with:

checkpoint = None if model_prefix is None else mx.callback.do_checkpoint(model_prefix)

Upvotes: 1

Related Questions