前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >caffe compilation troubleshooting

caffe compilation troubleshooting

作者头像
王云峰
发布2019-12-24 16:28:34
4330
发布2019-12-24 16:28:34
举报
文章被收录于专栏:Yunfeng's Simple Blog

Issue 1

When I compile caffe toolkit(actually, a caffe fork: lisa-caffe-public), I always encounter some errors like:

代码语言:javascript
复制
Tab found; better use space
Line should be <= 80 characters
Missing space before ( in if(

At the beginning, I thought these warnings were caused by gcc/g++, so I googled but found few result about this question. Then I read the manual of gcc. In the manual, I found some useful information:

  1. Adding -Wall parameter after gcc will display all warning information.
  2. Adding -w parameter will turn off all warning information.
  3. Adding -Wstring will display warning information about string. For example, if -Wfloat-equal is set, then it will warn if floating-point values are used in equality comparisons.
  4. Adding -Wno-string will not display warning information about string. For example, if -Wno-div-by-zero, then it will not warn if integer division by zero.

So I try to review Makefile of caffe and comment some lines, but the warning information remain. The knowledge is useful, but can’t solve my problem. After searching and searching, I finally found that it’s cpplint that caused errors. Cpplint is automated checker to make sure a C++ file follows Google’s C++ style guide. So I checked the Makefile, and find a line like this:

代码语言:javascript
复制
EVERYTHING_TARGETS := all py$(PROJECT) test warn lint

Explain: EVERYTHING_TARGETS is target of command make everything. When compile caffe, we can just type make everything then gcc will do everything for us, including make all, make test, make warn, make lint. So finally I got the simplest solution: just remove lint from this line and recompiled it. This time everything went well.

Issue 2

When I train network using lisa-caffe-public, I encounter error:

代码语言:javascript
复制
Unknown layer type: Python

I searched about this question and found the answer here: uncomment WITH__PYTHON_LAYER: =1 in Makefile.config and recompile it. lisa-caffe-public is a fork of fast-rcnn, which is a fork of original caffe of BVLC. The developer of fast-rcnn use Python layer in his implementation and lisa’s caffe fork inherits it. In order to run the network correctly, we must use the flag when compiling the source code.

Issue 3

Error message like this:

代码语言:javascript
复制
fatal error: caffe/proto/caffe.pb.h: No such file or directory

caffe.pb.h is a header file generated by Google Protocol Buffer. Here is a tutorial about it. We must first generate it use commands below:

代码语言:javascript
复制
$ protoc src/caffe/proto/caffe.proto --cpp_out=.
$ mkdir include/caffe/proto
$ mv src/caffe/proto/caffe.pb.h include/caffe/proto

Then compile again and we have the question solved. Reference from here

Issue 4

Error message like this:

代码语言:javascript
复制
Check failed: proto.SerializeToOstream(&output)

This error happens when write snapshot to disk. There are three reasons that cause this error:

  1. The writing directory doesn’t exist
  2. You have to permission to write in the directory
  3. The target disk is full

You can check these 3 aspects. Reference: https://github.com/BVLC/caffe/issues/1394

Issue 5

When use fast R-CNN, got error like this:

代码语言:javascript
复制
Floating point exception(core dumped).

It’s like something about box size. the solution is add filter_roidb function in lib/fast_rcnn/train.py file, like here. Reference: https://github.com/rbgirshick/py-faster-rcnn/issues/159

Issue 6

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-04-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Issue 1
  • Issue 2
  • Issue 3
  • Issue 4
  • Issue 5
  • Issue 6
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档