首页 > 学习Turbot-DL入门教程 > Turbot-DL入门教程篇-深度学习框架mxnet安装
2019
01-21

Turbot-DL入门教程篇-深度学习框架mxnet安装

Turbot-DL入门教程篇-深度学习框架mxnet安装

说明:

  • 介绍如何在turbot-DL上安装深度学习框架mxnet

步骤:

  • 新建目录

mkdir ~/dl/installMxnetTX1
cd ~/dl/installMxnetTX1
  • 安装依赖:

sudo apt-get update  
sudo apt-get install -y build-essential git libatlas-base-dev libopencv-dev
  • 下载mxnet:

#download mxnet from github
git clone --recursive https://github.com/dmlc/mxnet
  • 修改配置增加CUDA支持,无CUDA可不改:

  • 进入mxnet里面的make文件夹,更改config.mk

USE_CUDA=1
USE_CUDA_PATH = /usr/local/cuda
  • 非嵌入式,mxnet这个文件夹下:

make -j4
  • 嵌入式,修改mshadow.mk

cd mshadow/make
vim mshadow.mk
  • 修改内容:

  • 先找到-msse3,然后把它给删掉,并在下面加一行

ADD_CFLAGS=-DMSHADOW_USE_SSE=0
  • 进入dmlc-core文件夹,修改Makefile文件

cd dmlc-core
vim Makefile
  • 把-msse2给去掉,然后在下面一行加上

ADD_CFLAGS=-DMSHADOW_USE_SSE=0
  • 回到mxnet文件夹里面:

make -j4

测试:

  • 执行命令:

python example/image-classification/train_mnist.py
  • 输出:

INFO:root:start with arguments Namespace(batch_size=64, disp_batches=100, gpus=None, kv_store='device', load_epoch=None, lr=0.05, lr_factor=0.1, lr_step_epochs='10', model_prefix=None, mom=0.9, monitor=0, network='mlp', num_classes=10, num_epochs=20, num_examples=60000, num_layers=None, optimizer='sgd', test_io=0, top_k=0, wd=0.0001)
INFO:root:Epoch[0] Batch [100]  Speed: 948.66 samples/sec   accuracy=0.777692
INFO:root:Epoch[0] Batch [200]  Speed: 1030.88 samples/sec  accuracy=0.915781
INFO:root:Epoch[0] Batch [300]  Speed: 1034.63 samples/sec  accuracy=0.931250
INFO:root:Epoch[0] Batch [400]  Speed: 983.33 samples/sec   accuracy=0.932031
INFO:root:Epoch[0] Batch [500]  Speed: 968.70 samples/sec   accuracy=0.943906
INFO:root:Epoch[0] Batch [600]  Speed: 1004.47 samples/sec  accuracy=0.940625
INFO:root:Epoch[0] Batch [700]  Speed: 990.10 samples/sec   accuracy=0.950313
INFO:root:Epoch[0] Batch [800]  Speed: 941.56 samples/sec   accuracy=0.951094
INFO:root:Epoch[0] Batch [900]  Speed: 992.14 samples/sec   accuracy=0.955000
INFO:root:Epoch[0] Train-accuracy=0.957770
INFO:root:Epoch[0] Time cost=64.217
INFO:root:Epoch[0] Validation-accuracy=0.963276
INFO:root:Epoch[1] Batch [100]  Speed: 942.83 samples/sec   accuracy=0.964728
INFO:root:Epoch[1] Batch [200]  Speed: 925.19 samples/sec   accuracy=0.962187

问题:

  • 问题A: ImportError: No module named 'requests'

  • 解决:安装requests模块

pip install requests

参考:

  • https://github.com/dmlc/mxnet/tree/master/example

  • http://mxnet.io/get_started/install.html

  • http://mxnet.io/

  • https://github.com/dmlc/mxnet

  • http://blog.csdn.net/qq_25491201/article/details/51246458


本文》有 0 条评论

留下一个回复