在Ubuntu 14.04下配置FCIS的运行环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Cyril__Li/article/details/78167682

考完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并解压:

http://opencv.org/

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

如果一切正常则可以看到如下结果:
FCIS Demo

猜你喜欢

转载自blog.csdn.net/Cyril__Li/article/details/78167682