博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Centos7下安装部署MXNET
阅读量:6004 次
发布时间:2019-06-20

本文共 4667 字,大约阅读时间需要 15 分钟。

Centos下安装MXNET,参考官方文档http://mxnet.io/get_started/setup.html#prerequisites,

一、安装python的mxnet步骤如下:

#!/usr/bin/env bash####################################################################### This script installs MXNet for Python along with all required dependencies on a Fedora Machine.# Tested on Fedora 21.0 + distro.######################################################################set -eMXNET_HOME="$HOME/mxnet/"echo "MXNet root folder: $MXNET_HOME"echo "Installing basic development tools, atlas, opencv, pip, graphviz ..."sudo yum updatesudo yum groupinstall -y "Development Tools" "Development Libraries"sudo yum install -y atlas atlas-devel opencv opencv-devel graphviz graphviz-develecho "Building MXNet core. This can take few minutes..."cd "$MXNET_HOME"make -j$(nproc)echo "Installing Numpy..."sudo yum install numpyecho "Installing Python setuptools..."sudo yum install -y python-setuptools python-pipecho "Adding MXNet path to your ~/.bashrc file"         echo "export PYTHONPATH=$MXNET_HOME/python:$PYTHONPATH" >> ~/.bashrcsource ~/.bashrcecho "Install Graphviz for plotting MXNet network graph..."sudo pip install graphvizecho "Installing Jupyter notebook..."sudo pip install jupyterecho "Done! MXNet for Python installation is complete. Go ahead and explore MXNet with Python :-)"

测试下是否安装成功:

>>> import mxnet as mx>>>

ok,成功!

1 error解决:

1.1 安装opencv需要注意的地方:

1)、如果停在了下载ippicv的地方,可以自行下载ippicv_linux_20151201.tgz(链接:),

然后将刚才下载的ippicv文件直接拷贝进入opencv源码的下面这个目录:3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e

2)、错误:/usr/bin/ld: /usr/local/include/../lib/libswscale.a(swscale.o): relocation R_X86_64_PC32 against symbol `ff_M24A' can not be used when making a shared object; recompile with -fPIC

需要使用PIC选项重新编译ffmpeg: CFLAGS="-O3 -fPIC" ./configure --enable-nonfree --enable-pic --enable-shared

若ffmpeg正常安装后执行ffmpeg时出现如下错误:ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory

则 vim /etc/ld.so.conf加入:/usr/local/lib执行 ldconfig

 如果上面的方法都失败,那么需要如下处理:将FFmpeg静态库更改为使用动态:

sed -i -e 's/libavformat\.a/libavformat.so/g' \      -e 's/libavutil\.a/libavutil.so/g' \      -e 's/libswscale\.a/libswscale.so/g' \      -e 's/libavresample\.a/libavresample.so/g' \      -e 's/libavcodec\.a/libavcodec.so/g' \      cmake/OpenCVFindLibsVideo.cmake

然后:

cmake -D BUILD_opencv_gpu=OFF -D WITH_EIGEN=ON -D WITH_TBB=ON -D WITH_CUDA=OFF -D WITH_TIFF=OFF -DWITH_IPP=OFF -D WITH_1394=OFF -D CMAKE_BUILD_TYPE=RELEASE -DWITH_FFMPEG=ON -DWITH_GSTREAMER=OFF -D CMAKE_INSTALL_PREFIX=/usr/local  ..sudo make PREFIX=/usr/local install

 1.2 安装nnvm错误解决

1)如果出现这个错误:/usr/bin/ld: cannot find -lcblas

cd /usr/lib64

ln -s libcblas.so.3 libcblas.so

二、安装R包mxnet

#!/usr/bin/env bash####################################################################### This script installs MXNet for R along with all required dependencies on a Ubuntu Machine.# We recommend to install Microsoft RServer together with Intel MKL library for optimal performance# More information can be found here:# https://blogs.technet.microsoft.com/machinelearning/2016/09/15/building-deep-neural-networks-in-the-cloud-with-azure-gpu-vms-mxnet-and-microsoft-r-server/# Tested on Ubuntu 14.04+ distro.######################################################################set -eMXNET_HOME="$HOME/mxnet/"echo "MXNet root folder: $MXNET_HOME"echo "Building MXNet core. This can take few minutes..."cd "$MXNET_HOME"make -j$(nproc)echo "Installing R dependencies. This can take few minutes..."# make sure we have essential tools installedis_rscript_installed=$(which Rscript | wc -l)if [ "$is_rscript_installed" = "0" ]; then        read -p "Seems like Rscript is not installed. Install Rscript? [Y/n]"        if [ x"$REPLY" = x"" -o x"$REPLY" = x"y" -o x"$REPLY" = x"Y" ]; then                sudo apt-get install -y r-base-core        fifi# libcurl4-openssl-dev and libssl-dev are needed for devtools.sudo apt-get -y install libcurl4-openssl-dev libssl-dev# Needed for R XMLsudo apt-get install libxml2-devsudo Rscript -e "install.packages('devtools', repo = 'https://cran.rstudio.com')"cd R-packagesudo Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='https://cran.rstudio.com')); install_deps(dependencies = TRUE)"cd ..echo "Compiling R package. This can take few minutes..."sudo make rpkgecho "Installing R package..."sudo R CMD INSTALL mxnet_current_r.tar.gzecho "Done! MXNet for R installation is complete. Go ahead and explore MXNet with R :-)"

测试下是否安装成功:

> library(mxnet)Init Rcpp> > > a <- mx.nd.ones(c(2,3))> a     [,1] [,2] [,3][1,]    1    1    1[2,]    1    1    1

ok!

 

转载于:https://www.cnblogs.com/payton/p/6102744.html

你可能感兴趣的文章
EasyUI扩展组件、自定义组件
查看>>
java ssm 后台框架平台 项目源码 websocket 即时通讯 IM quartz springmvc
查看>>
20155229《网络对抗技术》Exp5:MSF基础应用
查看>>
[cocos-quick]在layer函数调用UIFile文件报错问题
查看>>
WPF中DataGrid双击命令获取选中的ViewModel
查看>>
ASP.NET MVC 随手记
查看>>
勤于思考:从客户端中检测到有潜在危险的 Request.Form 值
查看>>
交换机端口模式
查看>>
【笔记】cookies管理工具类
查看>>
mysql创建应用账号
查看>>
内存四区模型
查看>>
poj 3608:Bridge Across Islands
查看>>
跟JBPM学设计模式之建造者模式
查看>>
python3之tcp
查看>>
计算两个日期之间的天数
查看>>
力扣算法题—068文本左右对齐
查看>>
SharePoint 2013 安装.net framework 4.5已经存在更高版本的解决方案
查看>>
jsp读取properties文件
查看>>
ubuntu 11.10 initial configuration
查看>>
c#选择填空题题库
查看>>