未完成的 MXNET 安装?



我正在按照这里的教程进行操作:http://gluon.mxnet.io/P01-C02-ndarray.html。 我根据此处的说明安装了适用于Windows的mxnet:http://mxnet.io/get_started/windows_setup.html。

我没走多远就遇到了一些困难。 例如,运行以下

import mxnet as mx
from mxnet import nd
mx.random.seed(1)
y = nd.random_normal(shape=(3,4))
print(y.asnumpy())

给出此错误:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-16-a96a0205f28b> in <module>()
----> 1 y = nd.random_normal(shape=(3,4))
2 print(y.asnumpy())
AttributeError: 'module' object has no attribute 'random_normal'

我尝试打印出模块方法,确实似乎没有nd.random_normalnd.random_uniform或我希望从这里的文档中找到的任何其他nd.random_...方法:http://mxnet.io/api/python/ndarray.html#the-ndarray-class。 以下是我拥有的软件包:

dir(mx)
['AttrScope',
'Context',
'MXNetError',
'__builtins__',
'__doc__',
'__file__',
'__name__',
'__package__',
'__path__',
'__version__',
'absolute_import',
'attribute',
'base',
'callback',
'context',
'cpu',
'current_context',
'executor',
'executor_manager',
'gpu',
'init',
'initializer',
'io',
'kv',
'kvstore',
'kvstore_server',
'libinfo',
'lr_scheduler',
'metric',
'mod',
'model',
'module',
'mon',
'monitor',
'name',
'nd',
'ndarray',
'operator',
'optimizer',
'random',
'recordio',
'rnd',
'rtc',
'sym',
'symbol',
'symbol_doc',
'th',
'torch',
'visualization',
'viz']

我是否以某种方式管理了不完整的安装,或者这些方法可能在最近的更新中移动到命名空间的另一部分?

我假设您安装了预构建的 mxnet 最新发布版本。但是,这些文档基于 mxnet 的主/开发版本。请按照您已经提到的安装指南从源代码安装 mxnet:

http://mxnet.io/get_started/windows_setup.html#building-and-installing-packages-on-windows

最新更新