热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Ubuntu18.04安装caffepython3.6opencv3.2CPU

设置ubuntu的softwares&updates的源为国内源,这样会提高下载速度。如果是安装python相关库,为提高速度使用: pip3ins

设置ubuntu的softwares&updates的源为国内源,这样会提高下载速度。

如果是安装python相关库,为提高速度使用:

 pip3 install 要下载的库 -i https://国内源 

安装caffe依赖库:

 1 # python3 modules (numpy, protobuf, skimage)
 2 sudo pip3 install numpy
 3 sudo apt-get install python3-skimage
 4 sudo apt-get install python3-protobuf
 5 
 6 # build essential
 7 sudo apt-get install build-essential cmake git pkg-config
 8 
 9 # gflags, glog, lmdb
10 sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
11 
12 # boost
13 sudo apt-get install libboost-all-dev
14 
15 # hdf5
16 sudo apt-get install libhdf5-dev
17 
18 # protobuf
19 sudo apt-get install protobuf-compiler libprotobuf-dev
20 
21 # blas
22 sudo apt-get install libblas-dev libcblas-dev libatlas-base-dev libopenblas-dev
23 
24 # leveldb
25 sudo apt-get install libleveldb-dev
26 
27 # snappy
28 sudo apt-get install libsnappy-dev

安装opencv3.2

下载源代码 opencv-3.2.0.zip

1 unzip opencv-3.2.0.zip
2 cd opencv-3.2.0
3 mkdir release
4 cd release
5 cmake ..
6 make -j4
7 sudo make install

 

 

安装git:

 sudo apt-get install git 

安装caffe:

git clone https://github.com/BVLC/caffe

cd caffe

cp Makefile.config.example Makefile.config 

 

Makefile.config文件:

  1 ## Refer to http://caffe.berkeleyvision.org/installation.html
  2 # Contributions simplifying and improving our build system are welcome!
  3 
  4 # cuDNN acceleration switch (uncomment to build with cuDNN).
  5 # USE_CUDNN := 1
  6 
  7 # CPU-only switch (uncomment to build without GPU support).
  8 CPU_ONLY := 1
  9 
 10 # uncomment to disable IO dependencies and corresponding data layers
 11 # USE_OPENCV := 0
 12 # USE_LEVELDB := 0
 13 # USE_LMDB := 0
 14 # This code is taken from https://github.com/sh1r0/caffe-android-lib
 15 # USE_HDF5 := 0
 16 
 17 # uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
 18 #    You should not set this flag if you will be reading LMDBs with any
 19 #    possibility of simultaneous read and write
 20 # ALLOW_LMDB_NOLOCK := 1
 21 
 22 # Uncomment if you're using OpenCV 3
 23 OPENCV_VERSION := 3
 24 
 25 # To customize your choice of compiler, uncomment and set the following.
 26 # N.B. the default for Linux is g++ and the default for OSX is clang++
 27 # CUSTOM_CXX := g++
 28 
 29 # CUDA directory contains bin/ and lib/ directories that we need.
 30 CUDA_DIR := /usr/local/cuda
 31 # On Ubuntu 14.04, if cuda tools are installed via
 32 # "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
 33 # CUDA_DIR := /usr
 34 
 35 # CUDA architecture setting: going with all of them.
 36 # For CUDA <6.0, comment the *_50 through *_61 lines for compatibility.
 37 # For CUDA <8.0, comment the *_60 and *_61 lines for compatibility.
 38 # For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
 39 CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
 40         -gencode arch=compute_20,code=sm_21 \
 41         -gencode arch=compute_30,code=sm_30 \
 42         -gencode arch=compute_35,code=sm_35 \
 43         -gencode arch=compute_50,code=sm_50 \
 44         -gencode arch=compute_52,code=sm_52 \
 45         -gencode arch=compute_60,code=sm_60 \
 46         -gencode arch=compute_61,code=sm_61 \
 47         -gencode arch=compute_61,code=compute_61
 48 
 49 # BLAS choice:
 50 # atlas for ATLAS (default)
 51 # mkl for MKL
 52 # open for OpenBlas
 53 BLAS := atlas
 54 # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
 55 # Leave commented to accept the defaults for your choice of BLAS
 56 # (which should work)!
 57 # BLAS_INCLUDE := /path/to/your/blas
 58 # BLAS_LIB := /path/to/your/blas
 59 
 60 # Homebrew puts openblas in a directory that is not on the standard search path
 61 # BLAS_INCLUDE := $(shell brew --prefix openblas)/include
 62 # BLAS_LIB := $(shell brew --prefix openblas)/lib
 63 
 64 # This is required only if you will compile the matlab interface.
 65 # MATLAB directory should contain the mex binary in /bin.
 66 # MATLAB_DIR := /usr/local
 67 # MATLAB_DIR := /Applications/MATLAB_R2012b.app
 68 
 69 # NOTE: this is required only if you will compile the python interface.
 70 # We need to be able to find Python.h and numpy/arrayobject.h.
 71 #PYTHON_INCLUDE := /usr/include/python2.7 \
 72 #        /usr/lib/python2.7/dist-packages/numpy/core/include
 73 # Anaconda Python distribution is quite popular. Include path:
 74 # Verify anaconda location, sometimes it's in root.
 75 # ANACONDA_HOME := $(HOME)/anaconda
 76 # PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
 77         # $(ANACONDA_HOME)/include/python2.7 \
 78         # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include
 79 
 80 # Uncomment to use Python 3 (default is Python 2)
 81 PYTHON_LIBRARIES := boost_python3 python3.6m
 82 PYTHON_INCLUDE := /usr/include/python3.6m \
 83 #                 /usr/lib/python3.6/dist-packages/numpy/core/include
 84 
 85 # We need to be able to find libpythonX.X.so or .dylib.
 86 PYTHON_LIB := /usr/lib
 87 # PYTHON_LIB := $(ANACONDA_HOME)/lib
 88 
 89 # Homebrew installs numpy in a non standard path (keg only)
 90 # PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
 91 # PYTHON_LIB += $(shell brew --prefix numpy)/lib
 92 
 93 # Uncomment to support layers written in Python (will link against Python libs)
 94 WITH_PYTHON_LAYER := 1
 95 
 96 # Whatever else you find you need goes here.
 97 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
 98 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial
 99 
100 # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
101 # INCLUDE_DIRS += $(shell brew --prefix)/include
102 # LIBRARY_DIRS += $(shell brew --prefix)/lib
103 
104 # NCCL acceleration switch (uncomment to build with NCCL)
105 # https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
106 # USE_NCCL := 1
107 
108 # Uncomment to use `pkg-config` to specify OpenCV library paths.
109 # (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
110 # USE_PKG_CONFIG := 1
111 
112 # N.B. both build and distribute dirs are cleared on `make clean`
113 BUILD_DIR := build
114 DISTRIBUTE_DIR := distribute
115 
116 # Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
117 # DEBUG := 1
118 
119 # The ID of the GPU that 'make runtest' will use to run unit tests.
120 TEST_GPUID := 0
121 
122 # enable pretty build (comment to see full commands)
123 Q ?= @
View Code
推荐阅读
  • angular.element使用方法及总结
    2019独角兽企业重金招聘Python工程师标准在线查询:http:each.sinaapp.comangularapielement.html使用方法 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • Windows下配置PHP5.6的方法及注意事项
    本文介绍了在Windows系统下配置PHP5.6的步骤及注意事项,包括下载PHP5.6、解压并配置IIS、添加模块映射、测试等。同时提供了一些常见问题的解决方法,如下载缺失的msvcr110.dll文件等。通过本文的指导,读者可以轻松地在Windows系统下配置PHP5.6,并解决一些常见的配置问题。 ... [详细]
  • Windows 7 部署工具DISM学习(二)添加补丁的步骤详解
    本文详细介绍了在Windows 7系统中使用部署工具DISM添加补丁的步骤。首先需要将光驱中的安装文件复制到指定文件夹,并进行挂载。然后将需要的MSU补丁解压并集成到系统中。文章给出了具体的命令和操作步骤,帮助读者完成补丁的添加过程。 ... [详细]
  • 树莓派语音控制的配置方法和步骤
    本文介绍了在树莓派上实现语音控制的配置方法和步骤。首先感谢博主Eoman的帮助,文章参考了他的内容。树莓派的配置需要通过sudo raspi-config进行,然后使用Eoman的控制方法,即安装wiringPi库并编写控制引脚的脚本。具体的安装步骤和脚本编写方法在文章中详细介绍。 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的详细步骤
    本文详细介绍了搭建Windows Server 2012 R2 IIS8.5+PHP(FastCGI)+MySQL环境的步骤,包括环境说明、相关软件下载的地址以及所需的插件下载地址。 ... [详细]
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • 初始化初始化本地空版本库,仓库,英文名repositorymkdirtest&&cdtestgitinit克隆项目到本地gitclone远程同 ... [详细]
  • npminstall-Dbabelcorebabelpreset-envbabelplugin-transform-runtimebabelpolyfillbabel-loader ... [详细]
author-avatar
小忠
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有