Keras linux installation and problem solving

  • The installation is based on theano as the backend
  • The selected system is Centos6 32-bit
  1. Install the required packages
conda install numpy scipy mkl <nose> <sphinx> <pydot-ng>
#<...>为可选的包
pip install parameterized
  1. The GPU accelerator is not installed, but the installation needs to download the GPU download
  2. Stable Installation
conda install theano pygpu
&
pip install  Theano
  • libgpuarray
git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
git checkout tags/v0.6.5 -b v0.6.9
  • Bleeding-Edge Installation (recommended)
pip install <--user> <--no-deps> git+https://github.com/Theano/Theano.git#egg=Theano
  • libgpuarray
conda install -c mila-udem pygpu
  • Developer Installation
git clone git://github.com/Theano/Theano.git
cd Theano
<sudo> pip install <--user> <--no-deps> -e 
sudo yum install python-devel python-nose python-setuptools gcc gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel
sudo easy_install pip
  • Keras framework construction
pip install -U --pre pip setuptools wheel
pip install -U --pre numpy scipy matplotlib scikit-learn scikit-image
pip install -U --pre tensorflow-gpu #可能执行不成功,没关系继续执行
pip install -U --pre keras

Once installed, type python, then type:

>> import tensorflow
>> import keras

Error free output

  • Keras mnist dataset test download Keras development package
>>> git clone https://github.com/fchollet/keras.git
>>> cd keras/examples/
>>> python mnist_mlp.py

The program is carried out without errors, so far, the keras installation is complete

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324410356&siteId=291194637