考完GRE趕緊回來繼續搞實例分割,dockerhub上找了個fcis的docker,結果發現不好用=,=,折騰了一天也沒弄好,還是在實驗室的臺式機上自己重新裝個mxnet終於能跑fcis的demo了。
參考資料:
1. FCIS
2. Ubuntu14.04下MXNet安裝
步驟:
1. Clone the FCIS repository, and we’ll call the directory that you cloned FCIS as ${FCIS_ROOT}.
git clone https://github.com/msracver/FCIS.git
2. Build cython module
cd FCIS
sh ./init.sh
3. Install Opencv 3
FCIS代碼裏使用的是opencv3
3.1 Install dependencies
sudo apt-get install libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev cmake libswscale-dev libjasper-dev
3.2 下載opencv並解壓:
3.3 安裝opencv,在opencv根目mkdir build
cd build
cmake ..
make
sudo make install
3.4 配置設置:
sudo gedit /etc/ld.so.conf.d/opencv.conf
在打開的文件中添加opencv的鏈接庫路徑:
/usr/local/lib
3.5 繼續執行:
sudo ldconfig
sudo gedit /etc/bash.bashrc
在打開的文件中添加如下語句:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
4. Install MXNet:
4.1 Clone MXNet and checkout to MXNet@(commit 62ecb60)
git clone --recursive https://github.com/dmlc/mxnet.git
git checkout 62ecb60
git submodule update
4.2 Copy operators in $(FCIS_ROOT)/fcis/operator_cxx to $(YOUR_MXNET_FOLDER)/src/operator/contrib by
cp -r $(FCIS_ROOT)/fcis/operator_cxx/* $(MXNET_ROOT)/src/operator/contrib/
注意:
新版本的mxnet在operator下是沒有contrib文件夾的
4.3 Compile MXNet
cd ${MXNET_ROOT}
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
4.4 Install the MXNet Python binding
cd python
sudo python setup.py install
5. 運行FCIS的demo進行測試
首先下載訓練好的模型fcis_coco-0000.params
,放到./model/pretrained_model/
下,
python ./fcis/demo.py
如果一切正常則可以看到如下結果: