树莓派垃圾识别环境搭建
1.更换源,更换的是中科的源
备份源文件,执行如下命令
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
修改软件更新源,执行如下命令
sudo nano /etc/apt/sources.list
修改成中科大的软件源文件
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
修改系统更新源,执行如下命令
sudo nano /etc/apt/sources.list.d/raspi.list
修改成中科大的系统源地址
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui
同步更新源,执行如下命令
sudo apt-get update
sudo apt-get upgrade
2.安装python3.7,首先安装依赖包
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm
sudo apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev
下载
sudo wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
解压
sudo tar -zxvf Python-3.7.3.tgz
进入安装
cd Python-3.7.3
sudo ./configure --prefix=/usr/local/python3
sudo make
创建软链接
sudo ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
sudo ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
查看
python3 -V
pip3 -V
3.安装环境
安装
sudo pip3 install flask
安装scipy
sudo apt-get install python3-numpy python3-scipy
pip3 install tensorflow==1.13.1
pip3 install keras==2.3.1
sudo apt-get install libatlas-base-dev
sudo pip3 install scikit-learn