欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mxnet学习笔记-安装

程序员文章站 2024-03-14 12:29:04
...

Note:This blog without all the resources that are outside the original,reproduced please indicate the source.

官网,安装指导:mxnet.incubator.apache.org

选择合适自己的安装环境
mxnet学习笔记-安装
 本人MacOS,Python,CPU,Pip.

安装依赖

Install prerequisites - Homebrew, python developmenttools

 # Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ export PATH=/usr/local/bin:/usr/local/sbin:$PATH

# Install python development tools - python2.7, pip, python-setuptools
$ brew install python

安装 MXNet

安装mxnet需要最新版本的pip

$ pip install --upgrade pip
$ pip install --upgrade setuptools

安装mxnet

$ pip install mxnet==0.11.0

安装Graphviz(可选)

$ brew install graphviz
$ pip install graphviz

验证mxnet是否安装成功

bash打开python,输入测试代码:

>>> import mxnet as mx
>>> a = mx.nd.ones((2, 3))
>>> b = a * 2 + 1
>>> b.asnumpy()
-------
(正确会输出结果)
array([[ 3.,  3.,  3.],
       [ 3.,  3.,  3.]], dtype=float32)

mxnet学习笔记-安装

退出python

>>> exit()
$