Skip to content

Instantly share code, notes, and snippets.

@Shumakriss
Last active February 3, 2017 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shumakriss/9db9df065ee806e8b5435dcb90917393 to your computer and use it in GitHub Desktop.
Save Shumakriss/9db9df065ee806e8b5435dcb90917393 to your computer and use it in GitHub Desktop.
Keras Tutorial
Today I did a walkthrough on getting Keras installed. Keras is an abstraction on Tensorflow & Theano which are deep learning frameworks.
http://machinelearningmastery.com/introduction-python-deep-learning-library-keras/
[Chris@/Users/Chris]$ sudo pip install keras
Collecting keras
Downloading Keras-1.2.1.tar.gz (173kB)
100% |████████████████████████████████| 174kB 1.6MB/s
Collecting theano (from keras)
Downloading Theano-0.8.2.tar.gz (2.9MB)
100% |████████████████████████████████| 2.9MB 240kB/s
Requirement already satisfied: pyyaml in ./anaconda/lib/python3.5/site-packages (from keras)
Requirement already satisfied: six in ./anaconda/lib/python3.5/site-packages (from keras)
Requirement already satisfied: numpy>=1.7.1 in ./anaconda/lib/python3.5/site-packages (from theano->keras)
Requirement already satisfied: scipy>=0.11 in ./anaconda/lib/python3.5/site-packages (from theano->keras)
Installing collected packages: theano, keras
Running setup.py install for theano ... done
Running setup.py install for keras ... done
Successfully installed keras-1.2.1 theano-0.8.2
[Chris@/Users/Chris]$ pip list | grep tensorflow
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
tensorflow (0.12.1)
[Chris@/Users/Chris]$ mkdir .keras
[Chris@/Users/Chris]$ vim ~/.keras/keras.json
1 {
2 "image_dim_ordering": "tf",
3 "epsilon": 1e-07,
4 "floatx": "float32",
5 "backend": "tensorflow"
6 }
[Chris@/Users/Chris]$ python
Python 3.5.2 |Anaconda 4.1.1 (x86_64)| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from keras import backend
Using TensorFlow backend.
>>> print backend._BACKEND
File "<stdin>", line 1
print backend._BACKEND
^
SyntaxError: Missing parentheses in call to 'print'
>>> print(backend._BACKEND)
tensorflow
>>> quit()
http://machinelearningmastery.com/tutorial-first-neural-network-python-keras/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment