Tuesday, November 14, 2017

Install Keras on Linux


At first, install your python3.6.
$ sudo apt-get update
$ sudo apt-get install python3.6

Now pip3.
$ sudo apt-get install  python3-pip

Update pip3.
$ python3.6 -m pip install -U pip

Install setuptools.
$ python3.6 -m pip install setuptools

Install tensorflow.
If your PC doesn't have GPU:
$ python3.6 -m pip install tensorflow
If your PC has nvidia GPU:
$ python3.6 -m pip install tensorflow-gpu
(If your PC has nvidia GPU, you need also cuda. get the deb file from here: https://developer.nvidia.com/cuda-80-ga2-download-archive
and install cuda8.0 like $ sudo apt-get install cuda-8.0)

Install keras.
$ python3.6 -m pip install keras

Some basic packages for python3.6.
$ python3.6 -m pip install h5py
$ python3.6 -m pip install matplotlib
$ python3.6 -m pip install pillow
$ python3.6 -m pip install pandas

Use python to run keras programs.
Python3.6
$ python3.6 xxx.py