NX入门教程软件篇-安装MXnet带有cuda
NX入门教程软件篇-安装MXnet带有cuda
说明:
- 介绍如何安装MXnet
步骤:
- MXNet 1.7安装
$ wget https://raw.githubusercontent.com/AastaNV/JEP/master/MXNET/autoinstall_mxnet.sh
$ sudo chmod +x autoinstall_mxnet.sh
$ ./autoinstall_mxnet.sh <Nano/TX1/TX2/Xavier>
- MXNet 1.4 / 1.6
# Python 2.7
sudo apt-get install -y git build-essential libatlas-base-dev libopencv-dev graphviz python-pip
sudo pip install mxnet-1.4.0-cp27-cp27mu-linux_aarch64.whl
# Python 3.6
sudo apt-get install -y git build-essential libatlas-base-dev libopencv-dev graphviz python3-pip
sudo pip install mxnet-1.4.0-cp36-cp36m-linux_aarch64.whl
测试:
- 新建文件vim hello_world.py
import mxnet as mx
import mxnet.ndarray as nd
a = nd.ones(shape=(2,3),dtype='int32',ctx=mx.gpu(0))
print(a.shape, a.dtype, a.size, a.context)
- 效果
$ python3 hello_world.py
(2, 3) <class 'numpy.int32'> 6 gpu(0)
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号