2019-12-28 maskrcnn-benchmark入坑指南

maskrcnn-benchmark入坑指南

https://github.com/facebookresearch/maskrcnn-benchmark

1.環(huán)境安裝

指定python3.7的版本

conda create --name maskrcnn_benchmark python==3.7

conda remove -n maskrcnn_benchmark --all

https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/INSTALL.md

2.

python3.7

cuda9.0

export PATH=$PATH:/usr/local/cuda-9.0/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64

conda create --name maskrcnn_benchmark -y

conda activate maskrcnn_benchmark

# this installs the right pip and dependencies for the fresh python

conda install ipython pip

# maskrcnn_benchmark and coco api dependencies

pip install ninja yacs cython matplotlib tqdm opencv-python

# follow PyTorch installation in https://pytorch.org/get-started/locally/

# we give the instructions for CUDA 9.0

conda install -c pytorch pytorch-nightly torchvision cudatoolkit=9.0

export INSTALL_DIR=$PWD

# install pycocotools

cd $INSTALL_DIR

git clone https://github.com/cocodataset/cocoapi.git

cd cocoapi/PythonAPI

python setup.py build_ext install

# install cityscapesScripts

cd $INSTALL_DIR

git clone https://github.com/mcordts/cityscapesScripts.git

cd cityscapesScripts/

python setup.py build_ext install

# install apex

cd $INSTALL_DIR

git clone https://github.com/NVIDIA/apex.git

cd apex

python setup.py install --cuda_ext --cpp_ext

# install PyTorch Detection

cd $INSTALL_DIR

git clone https://github.com/facebookresearch/maskrcnn-benchmark.git

cd maskrcnn-benchmark

python setup.py build develop

unset INSTALL_DIR

3.

編譯問(wèn)題

_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c106Device8validateEv

原因的是maskrcnn-benchmark沒(méi)有編譯好

nvcc查看自己的路徑

which nvcc

/usr/bin/nvcc 這不是cuda9.0的nvcc所以報(bào)錯(cuò)

解決辦法

export PATH=/usr/local/cuda-9.0/bin:$PATH

cd /home/v-zhiwwa/HOI/maskrcnn/maskrcnn-benchmark && python setup.py build develop

4. 檢測(cè)一張圖片

export PATH=/usr/local/cuda-9.0/bin:$PATH

export PYTHON=$PYTHON:/home/v-zhiwwa/HOI/maskrcnn/maskrcnn-benchmark/build/lib.linux-x86_64-3.7

cd /home/v-zhiwwa/HOI/maskrcnn/maskrcnn-benchmark/demo && python wzw.py

5.檢測(cè)結(jié)果

圖片的目標(biāo)有bbox和分割的邊界

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容