Home » Uncategorized » Deep Learning with Python

Deep Learning with Python

A great and popular book on deep learning, and a good course using this book with.

Case 1 Set up profile and GPU on Tiguar

# standard setup for Python 3.5 
# (switches to the environment that has also MXNet)

export PATH=/ddn/gs1/home/klimczakl/miniconda2/bin:$PATH
source activate mxnet3

# on bioinfoX
export CUDA_VISIBLE_DEVICES=''

# on tiguar - your preferred GPU for multiple processes
#export CUDA_VISIBLE_DEVICES='1'

#Since Lez logs in as me, I can't use export CUDA_VISIBLE_DEVICES='1'

# use this to evaluate GPU memory 
nvidia-smi
# use next available GPU for if your preferred GPU close to full
export CUDA_VISIBLE_DEVICES='2'

export CUDA_ROOT=/ddn/gs1/home/klimczakl/miniconda2/envs/mxnet3
python

# now in Python interpreter
# alternatively include in your script
from keras import backend as K
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
sess = tf.Session(config=config)

# this will give you base GPU memory allocation
nvidia-smi

Special setup for Python 2.7

# special setup for Python 2.7 (use based environment)
# only for legacy Keras 0.3.3, Theano 0.8.2
# requires "backend": "theano" in .keras/keras.json

export PATH=/ddn/gs1/home/klimczakl/miniconda2/bin:$PATH
export CUDA_VISIBLE_DEVICES='1'
export CUDA_ROOT=/ddn/gs1/home/klimczakl/miniconda2

python -s

# now in Python interpreter
import theano


Leave a comment

Your email address will not be published. Required fields are marked *