Skip to content

Install tensorflow on server

elhava edited this page Jun 7, 2023 · 1 revision
  1. Connect to "Robin" which is the Sunnybrook server
ssh <username>@142.76.1.189
  1. Connect to lab server "lin1" or "lin2"
ssh lin2
  1. You can check the server details:

check the installed softwares:

rpm -qa

check the hardware:

lscpu
  1. download anaconda:
wget https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh
  1. check list of folders to ensure it is downloaded:
ls
  1. install anaconda:
bash Anaconda3-2018.12-Linux-x86_64.sh

it will ask if you want to install VScode. answer NO

  1. check if anaconda installed properly:
conda
  1. make your own virtual environment:
conda create --name <name of your environment>
  1. activate your env:
conda activate <name of your environment>
  1. check the GPU and cuda version of the server:
nvidia-smi
  1. if GPU is available install tensorflow-gpu:
conda install tensorflow-gpu
  1. check if tensorflow has been installed properly:
python
import sys
import tensorflow as tf
import tensorflow.keras

tf.__version__
tensorflow.keras.__version__
  1. check if tensorflow is working properly on the GPU:
tf.config.list_physical_devices('GPU')

above command returns a list of available gpus.

In other word, if len(tf.config.list_physical_devices('GPU'))>0 means that your tf is working on GPU.

Clone this wiki locally