Centos下安裝MXNET,參考官方文檔http://mxnet.io/get_started/setup.html#prerequisites,
#!/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)、如果停在了下載ippicv的地方,可以自行下載ippicv_linux_20151201.tgz(鏈接:http://www.linuxfromscratch.org/blfs/view/7.9/general/opencv.html),
然后將剛才下載的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正常安裝后執(zhí)行ffmpeg時出現(xiàn)如下錯誤: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執(zhí)行 ldconfig
如果上面的方法都失敗,那么需要如下處理:將FFmpeg靜態(tài)庫更改為使用動態(tài):
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)如果出現(xiàn)這個錯誤:/usr/bin/ld: cannot find -lcblas
cd /usr/lib64
ln -s libcblas.so.3 libcblas.so
#!/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 :-)"
測試下是否安裝成功:
ok!
聯(lián)系客服