y下载

https://github.com/BVLC/caffe

https://github.com/BVLC/caffe/archive/master.zip

gcc  

caffe安装 有2个问题 :

1,镜像系统类型,版本要求

2,是否使用cudnn(gpu) caffe要调用cudnn部分文件编译 (如用,cuda cudnn版本要求)


ubuntu1604-py35-nvidia-tensorflow1.14-cuda9.0-cudnn7.05

nvcc

2 nvcc -V

3 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4 yum install wget

5 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

6 wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

7 yum clean all

8 yum makecache

9 yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel

10 yum install gflags-devel glog-devel lmdb-devel make

11 export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:/usr/local/cuda-9.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH

12 export CUDA_HOME=/usr/local/cuda-9.0/

13 wget https://github.com/BVLC/caffe/archive/master.zip

14 unzip master.zip

15 yum install unzip

16 unzip master.zip

17 cd caffe-master/

18 ll

19 cd python/

20 ll

21 for req in $(cat requirements.txt); do pip install $req; done

22 yum install pip

23 yum install pip-devel

24 yum install python-pip

25 for req in $(cat requirements.txt); do pip install $req; done

26 c

27 for req in $(cat requirements.txt); do pip install -i https://mirrors.aliyun.com/pypi/simple/ $req; done

28 for req in $(cat requirements.txt); do pip install $req; done

29 wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz

30 pwd

31 cd /usr/local/src/

32 ls

33 wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz

34 xz -d Python-3.6.4.tar.xz

35 tar xvf Python-3.6.4.tar

36 cd Python-3.6.4

37 ./configure prefix=/usr/local/python3

38 make && make install

39 mv /usr/bin/python /usr/bin/python.bak

40 ln -s /usr/local/python3/bin/python3.6 /usr/bin/python

41 python -V

42 vi /usr/bin/yum

43 vi /usr/libexec/urlgrabber-ext-down

44 cd -

45 cd /caffe-master/python/

46 yum install python-pip3

47 yum install python-pip3-devel

48 yum install python3-pip

49 for req in $(cat requirements.txt); do pip install $req; done

50 python

51 cd /usr/local/src/

52 wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26

53 tar -zxvf setuptools-19.6.tar.gz

54 cd setuptools-19.6

55 python3 setup.py build

56 python setup.py build

57 python setup.py install

58 ls /usr/local/python3/bin/pip3

59 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

60 pip3 -V

61 cd /caffe-master/python/

62 ls

63 for req in $(cat requirements.txt); do pip3 install -i https://mirrors.aliyun.com/pypi/simple/ $req; done

64 for req in $(cat requirements.txt); do pip3 install $req; done

65 for req in $(cat requirements.txt); do pip3 install -i http://mirrors.aliyun.com/pypi/simple/ $req; done

66 vi ~/.pip/pip.conf

67 mkdir [global]

68 mkdir ~/.pip

69 vi ~/.pip/pip.conf

70 for req in $(cat requirements.txt); do pip3 install -i http://mirrors.aliyun.com/pypi/simple/ $req; done

71 for req in $(cat requirements.txt); do pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple $req; done

72 for req in $(cat requirements.txt); do pip install -i https://pypi.tuna.tsinghua.edu.cn/simple $req; done

73 python -m pip install --upgrade --force pip

74 easy_install -U setuptools

75 python -m pip install --upgrade --force pip

76 pip install --upgrade pip

77 for req in $(cat requirements.txt); do pip install -i https://pypi.tuna.tsinghua.edu.cn/simple $req; done

78 history

https://blog.csdn.net/kemgine/article/details/78781377

Caffe-GPU编译问题:nvcc fatal : Unsupported gpu architecture 'compute_20'

NVCC src/caffe/layers/bnll_layer.cu

nvcc fatal : Unsupported gpu architecture 'compute_20'

Makefile:594: recipe for target '.build_release/cuda/src/caffe/layers/bnll_layer.o' failed

make: *** [.build_release/cuda/src/caffe/layers/bnll_layer.o] Error 1

仔细查看了一下 Makefile.config 中 CUDA_ARCH 设置未按规定设置:

CUDA architecture setting: going with all of them.

For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.

For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.

For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.

CUDA_ARCH := -gencode arch=compute_20,code=sm_20

-gencode arch=compute_20,code=sm_21

-gencode arch=compute_30,code=sm_30

-gencode arch=compute_35,code=sm_35

-gencode arch=compute_50,code=sm_50

-gencode arch=compute_52,code=sm_52

-gencode arch=compute_60,code=sm_60

-gencode arch=compute_61,code=sm_61

-gencode arch=compute_61,code=compute_61

因为我装的是CUDA9.0所以把下面这两行删除就可以了

-gencode arch=compute_20,code=sm_20 \-gencode arch=compute_20,code=sm_21 \

https://gitlab.com/nvidia/container-images/cuda/blob/master/dist/centos7/10.1/runtime/cudnn7/Dockerfile

Caffe安装错误及其解决方法

https://blog.csdn.net/jessir/article/details/71195115

caffe编译的问题解决:“cublas_v2.h: No such file or directory

具体来说:

CUDA7.5中的include、lib路径是安装目录下/usr/local/cuda-7.5/targets/x86_64-linux/下面的include和lib

将其分别添加到caffe根目录下Makefile.config中的"INCLUDE_DIRS"、“LIBRARY_DIRS”后面就可以了。

make all

make test


cudnn-8.0/9.0/10.0-linux-x64-v6.0/7.0/7.1/7.2/7.3/7.4.tgz下载

https://blog.csdn.net/xiangxianghehe/article/details/79177833

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.3.1/cudnn-9.2-linux-x64-v7.3.1.20.tgz #cuda9.2 cudnn7.3

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.2.1/cudnn-9.2-linux-x64-v7.2.1.38.tgz #cuda9.2 cudnn7.2

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.4/cudnn-9.2-linux-x64-v7.1.tgz #cuda9.2 cudnn 7.1

http://file.ppwwyyxx.com/nvidia/cudnn-9.2-linux-x64-v7.4.2.24.tgz

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/cudnn-9.1-linux-x64-v7.tgz # cuda9.1 cudnn7.0

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.4/cudnn-9.0-linux-x64-v7.1.tgz

wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.3.0/cudnn-9.0-linux-x64-v7.3.0.29.tgz

make: /usr/local/cuda/bin/nvcc: Command not found

make: *** [.build_release/cuda/src/caffe/layers/absval_layer.o] Error 127

centos 7 安装caffe

https://blog.csdn.net/wqzghost/article/details/48264477

安装

https://juejin.im/post/5a0e819b6fb9a04524056583 在CentOS 7上安装Caffe

1.安装基础依赖库

sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel
sudo yum install gflags-devel glog-devel lmdb-devel

2.安装CUDA

sudo rpm -i cuda-repo-rhel7-8-0-local-ga2-8.0.61-1.x86_64.rpm
sudo yum clean all
sudo yum install cuda 环境变量
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda-8.0/

3.安装cuDNN

cp include/* /usr/local/cuda/include
cp lib64/* /usr/local/cuda/lib64

4.安装BLAS

sudo yum install atlas-devel
cd /usr/lib64/atlas
sudo ln -sv libsatlas.so.3.10 libcblas.so
sudo ln -sv libsatlas.so.3.10 libatlas.so

5.下载Caffe源码

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

6.安装python 依赖

进入caffe/python目录,安装requirements中依赖库

for req in $(cat requirements.txt); do pip install $req; done

7.编译

编辑Caffe 目录Makefile.config 文件,根据依赖库情况修改配置: 主要修改如下:
USE_CUDNN := 1
BLAS := atlas
BLAS_INCLUDE := /usr/include/atlas
BLAS_LIB := /usr/lib64/atlas
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib64/python2.7/site-packages/numpy/core/include
PYTHON_LIB := /usr/lib64 编译和测试Caffe,-j选项为编译并行线程数,一般为CPU核数
make all -j8
make test -j8
make runtest -j8

Caffe 使用示例

1.运行Caffe
进入Caffe 安装目录,执行./build/tools/caffe,可以根据caffe命令选项使用
./build/tools/caffe
caffe: command line brew
usage: caffe <command> <args> commands:
train train or finetune a model
test score a model
device_query show GPU diagnostic information
time benchmark model execution time
2.MNIST 例子
进入Caffe目录,执行如下命令
下载数据集:
./data/mnist/get_mnist.sh
转换数据集:
./examples/mnist/create_mnist.sh
训练例子:
./examples/mnist/train_lenet.sh 训练输出示例如下:

安装caffe

yum install epel-release

yum install atlas-devel snappy-devel boost-devel leveldb leveldb-devel hdf5 hdf5-devel glog glog-devel gflags gflags-devel protobuf protobuf-devel opencv opencv-devel lmdb lmdb-devel

yum -y install gcc automake autoconf libtool make

安装参考,但是失败了

https://blog.csdn.net/qq_33144323/article/details/81261367

失败错误为

[root@0e04e413eadd caffe]# make all
CXX src/caffe/blob.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/blob.hpp:8,yum
from src/caffe/blob.cpp:4:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
#include <cublas_v2.h>
^
compilation terminated.
make: *** [.build_release/src/caffe/blob.o] Error 1

yum install atlas-devel snappy-devel boost-devel leveldb leveldb-devel hdf5 hdf5-devel glog glog-devel gflags gflags-devel protobuf protobuf-devel opencv opencv-devel lmdb lmdb-devel

需求

jupyterlab 中使用caffe ,并且caffe能使用GPU, c++代码编写

centos7 下caffe GPU版的配置和TensorFlow gpu版本的安装
https://blog.csdn.net/qq_33144323/article/details/81261367

nvidia 官网

https://developer.nvidia.com/?destination=node/18866

centos 7 安装CUDA9.0 +CUDNN

https://www.jianshu.com/p/a201b91b3d96

编译caffe-gpu-cuda及cudnn-tar 下载地址的更多相关文章

  1. CUDA各版本官方下载地址

    一.CUDA各版本官方下载地址 地址:https://developer.nvidia.com/cuda-toolkit-archive 二.说明 备忘,平时找个版本太难找了.

  2. ubuntu16.04+caffe+GPU+cuda+cudnn安装教程

    步骤简述: 1.安装GPU驱动(系统适配,不采取手动安装的方式) 2.安装依赖(cuda依赖库,caffe依赖) 3.安装cuda 4.安装cudnn(只是复制文件加链接,不需要编译安装的过程) 5. ...

  3. 【软件安装与环境配置】ubuntu16.04+caffe+nvidia+CUDA+cuDNN安装配置

    前言 博主想使用caffe框架进行深度学习相关网络的训练和测试,刚开始做,特此记录学习过程. 环境配置方面,博主以为最容易卡壳的是GPU的NVIDIA驱动的安装和CUDA的安装,前者尝试的都要吐了,可 ...

  4. 真实机下 ubuntu 18.04 安装GPU +CUDA+cuDNN 以及其版本选择(亲测非常实用)【转】

    本文转载自:https://blog.csdn.net/u010801439/article/details/80483036 ubuntu 18.04 安装GPU +CUDA+cuDNN : 目前, ...

  5. 非root用户安装cuda和cudnn

    1.根据自己的系统在官网下载cuda (选择runfile(local)) https://developer.nvidia.com/cuda-downloads 2.进入下载目录,并执行 sh cu ...

  6. 判断OpenCV是否为共享库,Windows基于CMake编译Caffe需要opencv共享库

    判断OpenCV是否为共享库,Windows基于CMake编译Caffe需要opencv共享库 TLDR 只考虑windows下opencv预编译包的情况. 对于opencv2.4.x系列,cmake ...

  7. caffe搭建--caffe- win10 vs2015 编译(支持GPU)--注意在cmake的时候需要根据情况仔细修改配置

    --http://blog.csdn.net/longji/article/details/60964998 注意: 在cmake的时候需要根据情况仔细修改配置,比如,如果gpu的能力不足3.0的话, ...

  8. 【神经网络与深度学习】【CUDA开发】【VS开发】Caffe+VS2013+CUDA7.5+cuDNN配置过程说明

    [神经网络与深度学习][CUDA开发][VS开发]Caffe+VS2013+CUDA7.5+cuDNN配置过程说明 标签:[Qt开发] 说明:这个工具在Windows上的配置真的是让我纠结万分,大部分 ...

  9. 56 Marvin: 一个支持GPU加速、且不依赖其他库(除cuda和cudnn)的轻量化多维深度学习(deep learning)框架介绍

    0 引言 Marvin是普林斯顿视觉实验室(PrincetonVision)于2015年提出的轻量化GPU加速的多维深度学习网络框架.该框架采用纯c/c++编写,除了cuda和cudnn以外,不依赖其 ...

  10. Caffe使用新版本CUDA和CuDNN

    因为一些原因还是需要使用别人基于Caffe的代码,但是代码比较老,默认不支持高版本的cuda或者cudnn 怎么办呢?基本上就是把最新官方Caffe-BVLC的几个关键文件拿过来替换即可. 脚本如下: ...

随机推荐

  1. Linux解决Python调用Matlab函数无法导入matlab.engine问题及其他注意事项

    问题描述 Linux系统,根据matlab官方文档说明,利用Matlab中的API来实现Python调用Matlab函数.具体方法见文档: https://ww2.mathworks.cn/help/ ...

  2. 基于vant实现一个问卷调查

    实现背景 最近学习<vue实战>,第二篇进阶篇有一个练习 刚好最近在研究vue移动端框架vant 两者结合,实现这么个小项目 实现代码 新建 vue单文件 L0529L.vue <t ...

  3. 修改Docker0网桥默认网段

    Docker--修改Docker0网桥默认网段 修改文件 /etc/docker/daemon.json 添加内容 "bip": "ip/netmask" [ ...

  4. Go语言代码结构与语法基础(二)

    任何一门语言,都是从打印 hello world 开始的. 最简单的go代码: package main // 声明 main 包,表明当前是一个可执行程序 import "fmt" ...

  5. ubuntu 个人常用命令

    重启命令 :     1.reboot     2.shutdown -r now 立刻重启    3.shutdown -r 10 过10分钟自动重启    4.shutdown -r 20:35 ...

  6. 实例学习——爬取Pexels高清图片

    近来学习爬取Pexels图片时,发现书上代码会抛出ConnectionError,经查阅资料知,可能是向网页申请过于频繁被禁,可使用time.sleep(),减缓爬取速度,但考虑到爬取数据较多,运行时 ...

  7. 140. 后缀数组(hash + 二分 / 后缀数组)

    题目链接 : https://www.acwing.com/problem/content/description/142/ Hash + 二分 #include <bits/stdc++.h& ...

  8. 剑指offer-二进制中1的个数-进制转化-补码反码原码-python

    题目描述 输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示.   ''' 首先判断n是不是负数,当n为负数的时候,直接用后面的while循环会导致死循环,因为负数 向左移位的话最高位补1 ...

  9. Android多渠道打包且根据不同产品打包不同的assets资源目录

    因为项目中存在多种环境,既要区分bebug与release版本,release又要区分测试环境与生产上线环境,每次打包都得浪费不少的等待时间:并且哪个版本有问题还得去切换环境一个个打包,关键是还得牢记 ...

  10. java 并发编程lock使用详解

    浅谈Synchronized: synchronized是Java的一个关键字,也就是Java语言内置的特性,如果一个代码块被synchronized修饰了,当一个线程获取了对应的锁,执行代码块时,其 ...