MXNet(DL)
博客专区 > 赵-猛 的博客 > 博客详情
MXNet(DL)
赵-猛 发表于1个月前
MXNet(DL)
  • 发表于 1个月前
  • 阅读 2
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 十分钟定制你的第一个小程序>>>   

#install basic tool

sudo apt-get update
sudo apt-get install -y build-essential git 

#install opencv

#download, compile and install opencv
sudo apt-get install libopencv-dev

#install one blas: openblas/apple/atlas/mkl

#download, compile and install one blas version
sudo apt-get install libopenblas-dev
#sudo apt-get install libblas-dev
#sudo apt-get install libatlas-dev

#cublas is in cuda, and is for GPU

#install cuda for nvidia gpu (include cublas cusparse)

wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.61-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_8.0.61-1_amd64.deb
(
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
)
sudo apt-get update
sudo apt-get install cuda

#check gpu
nvidia-smi

#install cudnn for nvidia gpu (no need)

#instal cudnn

#add cuda lib for nvidia gpu

#export LD_LIBRARY_PATH=/usr/local/cuda/targets/x86_64-linux/lib/:$LD_LIBRARY_PAT

 


#download and compile mxnet

git clone --recursive https://github.com/dmlc/mxnet
cd mxnet

#compile
mv make/config.mk config.mk
atom config.mk
    USE_CUDA = 1
    USE_CUDA_PATH = /usr/local/cuda
    USE_BLAS = openblas
make -j8

#install mxnet for python

cd python
python setup.py install

#install ipython and ipthon-notebook to study the guide

sudo apt install ipython
sudo apt install ipython-notebook

#在当前目录下启动notebook
ipython notebook

#chrome http://localhost:8888/

 


#train using cpu

cd example/image-classification
python train_mnist.py

#train using gpu

model = mx.model.FeedForward(
        ctx = mx.cpu(), symbol = mlp, num_epoch = 20,
        learning_rate = 0.1, momentum = 0.9, wd = 0.00001)  
=>
model = mx.model.FeedForward(
        ctx = mx.gpu(), symbol = mlp, num_epoch = 20,
        learning_rate = 0.1, momentum = 0.9, wd = 0.00001)   

#predict 

#TODO

 


#training resnet

git clone https://github.com/tornadomeet/ResNet.git
cd ResNet
im2rec_path train.lst train/ data/imagenet/train_480_q90.rec resize=480 quality=90
python -u train_resnet.py --data-dir data/imagenet --data-type imagenet --depth 50 --batch-size 256  --gpus=0,1,2,3,4,5

#predict resnet

#TODO

 

 

#face_detetect(using existed model)

git clone https://github.com/pangyupo/mxnet_mtcnn_face_detection
cd mxnet_mtcnn_face_detection

pip install opencv-python

python main.py
(python mtcnn_detector.py)

 

共有 人打赏支持
粉丝 4
博文 78
码字总数 346732
×
赵-猛
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: