avatar  


Recently viewed tickets

Log out

Loading Tensorflow on Hoffman2

Updated on Oct 25, 2021

Example commands to load TensorFlow 2.x on a CPU node (without GPU):



$ qrsh -l h_data=4G -pe shared 4
$ module load anaconda3
$ . $CONDA_DIR/etc/profile.d/conda.sh
$ conda activate tf2-cpu
(tf2-cpu) $ python -c 'import tensorflow as tf; print(tf.__version__)'
2.6.0
(tf2-cpu) $ python -c "import numpy; print(numpy.__version__)"
1.19.5
(tf2-cpu) $ conda list protobuf
# packages in environment at /u/local/apps/anaconda3/2020.11/envs/tf2-cpu:
#
# Name                    Version                   Build  Channel
libprotobuf               3.15.8               h780b84a_1    conda-forge
protobuf                  3.18.0                   pypi_0    pypi
(tf2-cpu) $ conda deactivate
(base) $ exit


Example commands to load TensorFlow 2.x on a GPU node:


$ qrsh -l h_data=4G,gpu,RTX2080Ti
$ module load anaconda3
$ . $CONDA_DIR/etc/profile.d/conda.sh
$ conda activate tf2-gpu
(tf2-gpu) $ python -c 'import tensorflow as tf; print(tf.__version__)'
2.4.1
(tf2-gpu) $ conda deactivate
(base) $ exit

Example commands to load TensorFlow 1.x on a CPU node:


$ qrsh -l h_data=4G -pe shared 4
$ module load anaconda2
$ . $CONDA_DIR/etc/profile.d/conda.sh
$ conda activate tf-1.15.0-cpu
(tensorflow-cpu) $ python -c 'import tensorflow as tf; print(tf.__version__)'
1.15.0
(tensorflow-cpu) $ conda deactivate
(base) $ exit


Example commands to load TensorFlow 1.x on a GPU node:



$ qrsh -l gpu,P4
$ module load anaconda2
$ . $CONDA_DIR/etc/profile.d/conda.sh
$ conda activate tf-1.15.0-gpu
(tensorflow-gpu) $ python -c 'import tensorflow as tf; print(tf.__version__)'
1.15.0
(tensorflow-gpu) $ conda deactivate
(base) $ exit


Creation date: 6/16/2020 4:29 PM (huqy)      Updated: 10/25/2021 10:40 AM (dauria)