我试图运行安装Mxnet deeplearning框架,但是当我尝试运行python示例时,由于以下错误而失败,我无法在网络中找到最佳处理。
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'
答案 0 :(得分:1)
save_model_prefix
仅在15天前推出。您很可能在此之前安装了mxnet
,因此有一个不支持它的版本。
您可以从源重新安装最新的mxnet
,也可以在示例中修复问题。对于那个开放的train_model.py
(请参阅回溯中的完整路径),并更改以下四行:
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)
使用:
checkpoint = None if model_prefix is None else mx.callback.do_checkpoint(model_prefix)