caffe安装中碰到的一些问题

本文详细记录了Caffe安装过程中遇到的问题及解决方法,特别聚焦于Protobuf的源码编译与安装流程,包括依赖安装、配置、编译、检查与安装步骤,以及可能遇到的bug解决方案。

caffe安装中碰到的一些问题:
protobuf源码编译与安装
1.下载protobuf源码

git clone https://github.com/google/protobuf.git
这是3.6.1版本的

2.安装编译所需的依赖

sudo apt install -y autoconf automake libtool curl make g++ unzip

3.产生配置脚本

./autogen.sh

4.编译与安装

$ ./configure --prefix=/usr
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.

5.protoc生成java代码
protoc -I= S R C D I R − − j a v a o u t = SRC_DIR --java_out= SRCDIRjavaout=DST_DIR $SRC_DIR/addressbook.proto

期间可能出现的bug:

  1. make时出现的bug:
    1)…/libtool: eval: line 7980: unexpected EOF while looking for matching "': 在对应行后面加||,哪一行报错就在哪里的行尾加。 2)ar:u’ modifier ignored since D' is the default (seeU’):
    本来是cru,改成了AR_FLAGS=“cr”
    最终版:Protobuf 3.6.1下载下来以后,按照上面的安装,但是安装后面不报错的退出就按不动了,然后make clean,换cmake安装:
    https://github.com/protocolbuffers/protobuf/issues/5144
    换cmake安装protobuf过程:
    CMake does build and run without error. It’s not obvious cmake is supported for Linux, the instructions only mention Windows. For those that run into this in the future, here are the commands I used for building for Linux:
    cd protobuf/cmake
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF …/
    make -j16
    装完以后,继续在build里,再用make安装:
    sudo make -j16
    sudo make install
    打开~/.bashrc 改路径:
    export PROTOBUF_HOME=/usr/local/protobuf/protobuf-master
    export PATH= P R O T O B U F H O M E / b i n : PROTOBUF_HOME/bin: PROTOBUFHOME/bin:PATH
    source ~/.bashrc

目前caffe安装进展:
考虑到caffe的安装需要对应的ubuntu系统和g++版本等严格要求,暂时先终止安装。
如果后续要安装可以参考一下在docker上安装:
https://github.com/ufoym/deepo
或者参考以下网址:
https://blog.csdn.net/chenzhenyu123456/article/details/84205974

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值