深度学习Caffe平台安装——Ubuntu安装CPU模式的caffe

 

深度学习Caffe平台安装——Ubuntu安装CPU模式的caffe

按照这篇博客安装正确;

将caffe下拉到/usr/local/lib/python2.7/dist-packages下;

在 make pycaffe 时报错:
src/caffe/layers/image_data_layer.cpp:2:33: fatal error: opencv2/core/core.hpp: 没有那个文件或目录
compilation terminated.
Makefile:581: recipe for target '.build_release/src/caffe/layers/image_data_layer.o' failed
make: *** [.build_release/src/caffe/layers/image_data_layer.o] Error 1

解决方法:没有安装opencv依赖

===========
/usr/bin/ld: 找不到 -lopencv_imgcodecs collect2: error: ld returned 1 exit status
解决方法:http://blog.csdn.net/w113691/article/details/77942408

先将Makefile.config文件中

OPENCV_VERSION :=3 注释掉,只修改USE_OPENCV := 1

修改后的结果:

USE_OPENCV := 1

#OPENCV_VERSION := 3


在caffe根目录下,找到Makefile文件,打开文件

查找“Derive include and lib directories”一节,修改“LIBRARIES +=”的最后一行(LIBRARIES +=opencv_imgcodecs ),增加opencv_imgcodecs

opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

(此时应该变为LIBRARIES += opencv_imgcodecs  opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

保存,退出。

注意:在做前边的基础工作是将Makefile.config文件中

OPENCV_VERSION :=3 注释掉,只修改USE_OPENCV := 1

再在caffe目录下,sudo make all -j8一下,问题解决

# Uncommentif you're using OpenCV 3 OPENCV_VERSION := 3
# Uncommentif you're using OpenCV 3 OPENCV_VERSION := 3

=================================================

安装caffe源码:http://caffe.berkeleyvision.org/install_apt_debian.html

安装caffe:http://caffe.berkeleyvision.org/install_apt.html

安装OpenCV:https://linuxconfig.org/install-opencv-on-ubuntu-18-04-bionic-beaver-linux


sudo apt-get install Gparted

编辑source,添加:
sudo gedit  /etc/apt/sources.list
deb http://ftp.cn.debian.org/debian sid main contrib non-free
deb-src http://ftp.cn.debian.org/debian sid main contrib non-free
或者(1.0.0-6)
deb http://ftp2.cn.debian.org/debian sid main contrib non-free
deb-src http://ftp2.cn.debian.org/debian sid main contrib non-free
$ sudo apt update
$ sudo apt install build-essential debhelper devscripts  # standard package building tools
$ sudo apt build-dep [ caffe-cpu | caffe-cuda ]          # the most elegant way to pull caffe build dependencies
$ apt source [ caffe-cpu | caffe-cuda ]                  # download the source tarball and extract
$ cd caffe-XXXX
[ ... optional, customizing caffe code/build ... ]
$ dch --local "Modified XXX"                             # bump package version and write changelog
$ debuild -B -j4                                         # build caffe with 4 parallel jobs (similar to make -j4)
[ ... building ...]
$ debc                                                   # optional, if you want to check the package contents
$ sudo debi                                              # optional, install the generated packages
$ ls ../                                                 # optional, you will see the resulting packages


debian系linux更新时,提示“由于没有公钥,无法验证下列签名”

https://blog.csdn.net/yjk13703623757/article/details/78998443

# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553

# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值