Skip to content

Instantly share code, notes, and snippets.

@VieVie31
Created November 30, 2017 21:19
Show Gist options
  • Save VieVie31/72afe05a004e81918a973fa5424fa824 to your computer and use it in GitHub Desktop.
Save VieVie31/72afe05a004e81918a973fa5424fa824 to your computer and use it in GitHub Desktop.

How to run Keras + Tensorflow on GPU @UPMC

Connection @UPMC network

Change XXXXXXX by your student id :

ssh XXXXXXX@ssh.ufr-info-p6.jussieu.fr

Change Y by the id of the machine :

ssh XXXXXXX@ppti-gpu-Y

On a GPU machine

Once you are connected on a GPU machine, nothing is setup and you haven't privileges to install anything... There is not even pip installed !!!! :o

#install pip and pip3 only for one user : you => no root needed ! :D
easy_install --user pip 

#add pip to the path 
PATH=$PATH:~/.local/bin
echo "PATH=\$PATH:~/.local/bin" >> ~/.bashrc

#check if worked...
pip3 --version

#install keras & tensorflow... :D
pip3 install --user keras
pip3 install --user tensorflow
pip3 install --user tensorflow-gpu #install tensorflow fo GPU

#test the cifar example
cd /tmp
mkdir cifar_example
cd cifar_example

wget https://raw.githubusercontent.com/fchollet/keras/master/examples/cifar10_cnn.py
python3 cifar10_cnn.py
sed -i '19s/.*/data_augmentation = False/' cifar10_cnn.py
python3 cifar10_cnn.py

F**k only cuda9 is installed !!!

TF is still on cuda8... :'(

You can't still use keras with tensorflow for gpu : remove it !

#clean all tensorflow
pip3 uninstall tensorflow-gpu
pip3 uninstall tensorflow

#and reinstall it for CPU only...
pip3 install --user tensorflow

Enjoy the fast CPU ! :D and pray for the cuda9 tf version... :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment