2. 安装python基础开发包
# 系统升级
sudo apt update
sudo apt upgrade
sudo apt install -y python-dev python-pip python-nose gcc g++ git gfortran vim
3.安装运算加速库
sudo apt install -y libopenblas-dev liblapack-dev libatlas-base-dev
4.安装相关开发包
安装pip , sudo pip install -U --pre pip setuptools wheel
安装numpy,scipy, matplotlib,scklearn包 , sudo pip install -U --pre numpy scipy matplotlib scikit-learn scikit-image
安装theano
, sudo pip install -U --pre theano
安装keras,
sudo pip install -U --pre keras
安装tensorflow,sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
5.keras环境设置
1)修改默认keras后端 在终端
中输入:
gedit ~/.keras/keras.json
2)配置theano文件 在终端
中输入:
gedit ~/.theanorc
6.本人采用的是cpu加速,故在theanorc
中输入
[global]
openmp=True
device = cpu
floatX = float32
allow_input_downcast=True
[blas] ldflags= -lopenblas