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

前端之家收集整理的这篇文章主要介绍了深度学习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_imgcodecsopencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

保存,退出

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

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

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

# 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

猜你在找的Ubuntu相关文章