In the previous TensorFlow Exercise 1 I mentioned a high-level library using TensorFlow as the backend, called Keras, which is a high-level neural network Python library. In TensorFlow Exercise 1, I was manually defining a neural network, with a few lines of code to take care of it.
The first Keras use Theano as the back end, TensorFlow after the fire, Keras added TensorFlow support Keras source code: Https://github.com/fchollet/keras How to master deep learning through Keras: http://blog.csdn.net/jdbc/article/details/71933555
Keras Document: Https://keras.io Another package TensorFlow's advanced library-tflearn:https://github.com/tflearn/tflearn keras Chinese online:/http Keras-cn.readthedocs.io/en/latest/tensorflow Chinese document online: http://www.tensorfly.cn/deep learning Framework Keras installation: http://blog.csdn.net/ u012556077/article/details/50364640 Windows environment Keras Deep Learning Framework Configuration: http://blog.csdn.net/zhengjia0826/article/details/ 52571686 Deep Learning Framework Keras experience: http://blog.csdn.net/xjcvip007/article/details/52801216
this post records the steps to install Keras and uses TensorFlow to do the backend. (The system used is Ubuntu, see detailed configuration information). #1 Create a virtual environment
In order to keep the Python development environment tidy, virtual environments are essential.
First create a virtual environment:
Mkvirtualenv KERAS_TF #--python=python2.7 Specifies the python version used
Workon KERAS_TF
#2 Installing TensorFlowUbuntu 16.04 Installation TensorFlow (GPU support)
Pip Install--upgrade <tensorflow_url>
#3 Installing Keras
Pip install numpy scipy
pip install scikit-learn
pip install Pillow
pip install h5py
pip install Keras
Perform:
Python
>>> Import Keras
To edit a configuration file Keras.json:
~/.keras/keras.json
Make sure the content is:
{
"image_dim_ordering": "TF",
"epsilon": 1e-07,
"Floatx": "float32",
"backend": "TensorFlow"
}
Image_dim_ordering:tensorflow is using the numpy array (height, width, depth). If you use Theano, the array representation method (depth, height, width).
If you are installing OPENCV, see: Ubuntu 16.04 Compiling and installing OpenCV (Python)
Reprinted from: http://blog.topspeedsnail.com/archives/10427