Ubuntu 18.4.4LTS安装caffe
更换下载源
cd /etc/apt
先备份以前下载源文件
sudo cp sources.list source.list.backup
使用vi
或者 vim
或者 gedit
编辑sources.list
文件
gedit sources.list
更换里面的文件内容为
##中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
安装caffe
使用 sudo apt install caffe-cpu
但是有个问题 ,无法照着网上的其他教程找到caffe文件夹,拿到官方数据集mnist
解决方法一
从github仓库下载源
git clone https://github.com/BVLC/caffe.git
获得caffe文件
进入caffe文件夹
使用命令文件
./data/mnist/get_mnist.sh
打开下载目录caffe/data/mnist
也可以复制
get_mnist.sh
文件里的内容 到任意文件夹里面执行#!/usr/bin/env sh # This scripts downloads the mnist data and unzips it. DIR="$( cd "$(dirname "$0")" ; pwd -P )" cd "$DIR" echo "Downloading..." for fname in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte do if [ ! -e $fname ]; then wget --no-check-certificate http://yann.lecun.com/exdb/mnist/${fname}.gz gunzip ${fname}.gz fi done
后面发现 如果要使用caffe文件夹下面的 caffe/bulid
下的工具包,可直接使用,这个安装方式,所以的工具都已经被写入到 linux
中的PATH
中
安装成功
关于whereis which find locate
Linux命令说明和使用