記錄一下安裝mxnet...使用的服務(wù)器上已經(jīng)有cuda和cudaCNN還有hadoop了,沒有裝cuda和cudnn的可以看我caffe的安裝博客。從github上clone下來mxnet,需要改make下的config.mk。注意事項(xiàng):
在mxnet的根目錄下make。一定要記得,直接make,直接make,直接make!!!!!! cmake是準(zhǔn)備給windows的!!!完了你覆蓋了原本的makefile的話就gg了。。??梢詍ake -j#() 根據(jù)自己的配置決定。
改config.mk的時(shí)候,主要按照自己的pc配置改USE_CUDA, USE_CUDACNN, 同時(shí)我還加了:
# the additional link flags you want to add
ADD_LDFLAGS = -L/home/shixin/local/lib -L/home/shixin/local/lib64
# the additional compile flags you want to add
ADD_CFLAGS = -I/home/shixin/local/include -I/home/shixin/include
重新make的話記得把build文件夾刪掉...或者用別人拷給你的mxnet的話一定要?jiǎng)h掉build文件夾,不然會(huì)提示路徑里面有文件找不到什么的。
如果遇到以下錯(cuò)誤:
Makefile:23: mshadow/make/mshadow.mk: No such file or directory
Makefile:24: dmlc-core/make/dmlc.mk: No such file or directory
Makefile:86: ps-lite/make/ps.mk: No such file or directory
是git clone的時(shí)候需要git clone --recursive <url>,因?yàn)閙xnet依賴于DMLC通用工具包http://dmlc.ml/,--recursive參數(shù)可以自動(dòng)加載mshadow等依賴。
- 我使用的是python接口。注意:執(zhí)行任何demo都需要import find_mxnet,當(dāng)然前提要保證執(zhí)行文件夾下有find_mxnet.py:
try:
import mxnet as mx
except ImportError:
import os, sys
curr_path = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(curr_path, ".."))
import mxnet as mx
sys.path.append添加的路徑必須是有安裝mxnet的時(shí)候python/mxnet文件夾的。不使用find_mxnet.py的話,需要直接把python/mxnet文件夾放到執(zhí)行的目錄下。
- 報(bào)錯(cuò)找不到libmxnet.so?解決方案:把安裝目錄/lib下的libmxnet.so復(fù)制到python/mxnet中。