colab上安装caffe,各种cannot find xxx的情况

跑代码Instance-aware Semantic Segmentation via Multi-task Network Cascades

需要用到caffe,阅读README.md

Clone the MNC repository:

# Make sure to clone with --recursive
git clone --recursive https://github.com/daijifeng001/MNC.git
Install Python packages: numpy, scipy, cython, python-opencv, easydict, yaml.

Build the Cython modules and the gpu_nms, gpu_mask_voting modules by:

cd $MNC_ROOT/lib
make
Install Caffe and pycaffe dependencies (see: Caffe installation instructions for official installation guide)

Note: Caffe must be built with support for Python layers!

# In your Makefile.config, make sure to have this line uncommented
WITH_PYTHON_LAYER := 1
# CUDNN is recommended in building to reduce memory footprint
USE_CUDNN := 1
Build Caffe and pycaffe:

 cd $MNC_ROOT/caffe-mnc
 # If you have all of the requirements installed
 # and your Makefile.config in place, then simply do:
 make -j8 && make pycaffe

按上图的步骤下载python packages,再在lib文件夹下make

接着安装caffe和依赖,先从github上下载caffe,

!git clone https://github.com/BVLC/caffe && cd caffe

接着按给的Makefile.config.example复制一份Makefile.config,按照自己的配置删改,这些可先跑一下看看有哪些错误,然后删减,其他博客也有很多详细介绍

先把caffe依赖装好

不是colab的直接删掉前面感叹号就好

!sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
!sudo apt-get install git
!sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev
!sudo apt-get install --no-install-recommends libboost-all-dev
!sudo apt-get install libatlas-base-dev
!sudo apt-get install python-dev
!sudo apt-get install libhdf5-dev
!sudo apt-get install libhdf5-serial-dev protobuf-compiler
import os
path = "/content/drive/My Drive/MNC-master/lib/caffe"
os.chdir(path)
!make clean
!make all -j8

再clean后重新编译,有错的就去百度,基本是Makefile哪里不对要改,看usr/lib文件夹路径啥的

接着就安装ok

执行make pycaffe

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值