Repository to keep notebooks from Deep Learning A-Z 2024 course
Refer: https://docs.anaconda.com/anaconda/install/linux/
- Install dependent libraries
apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
- To download the installer, open a terminal and use the following command, depending on your Linux architecture:
# Replace <INSTALLER_VERSION> with the version of the installer file you want to download # For example, https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh # All installers can be found at repo.anaconda.com/archive/ curl -O https://repo.anaconda.com/archive/Anaconda3-<INSTALLER_VERSION>-Linux-x86_64.sh
- To install, run the following command (Linux x86)
# Include the bash command even if you aren't using the Bash shell # Replace ~/Downloads with the path to the installer file, if necessary # Replace <INSTALLER_VERSION> with the version of the installer file # For example, Anaconda3-2023.09-0-Linux-x86_64.sh bash ~/Downloads/Anaconda3-<INSTALLER_VERSION>-Linux-x86_64.sh
- Initialize conda
# Replace <PATH_TO_CONDA> with the path to your conda install source <PATH_TO_CONDA>/bin/activate conda init
conda create -n tf-gpu tensorflow-gpu
conda activate tf-gpu(tdqm is optional)
pip install pandas matplotlib scikit-learn scipy tdqm keras
conda install -c conda-forge jupyterlabInstall tenserflow (https://www.tensorflow.org/install/pip)
-
Verify gpu (or skip for cpu only)
nvidia-smi
-
Create a virtual environment with venv
python3 -m venv tf-gpu source tf-gpu/bin/activate -
Install tensorflow (gpu)
pip install --upgrade pip pip install tensorflow[and-cuda]
or install tensorflow (cpu only)
pip install tensorflow
-
Verify the installation
- [cpu]
python3 -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))" - [gpu]
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
- [cpu]
-
[GPU only] Virtual environment configuration
Create symbolic links to NVIDIA shared libraries:
pushd $(dirname $(python -c 'print(__import__("tensorflow").__file__)')) ln -svf ../nvidia/*/lib/*.so* . popd
Create a symbolic link to ptxas:
ln -sf $(find $(dirname $(dirname $(python -c "import nvidia.cuda_nvcc; print(nvidia.cuda_nvcc.__file__)"))/*/bin/) -name ptxas -print -quit) $VIRTUAL_ENV/bin/ptxas
Verify the GPU setup:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
pip install pandas matplotlib scikit-learn scipy tdqm kerasEither install Jupyter Lab or just Jupyter Notebook as per the requirement
pip install jupyterlabor
pip install notebookconda activate tf-gpujupyter labsource tf-gpu/bin/activatejupyter labor
jupyter notebook