Last active
February 15, 2022 09:07
-
-
Save mjkvaak/ad0fea057d5a733dc76524825f21dee2 to your computer and use it in GitHub Desktop.
Installation of Tensorflow 2.X with GPU on Ubuntu 18.04/20.04 with conda and pip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install nvidia-drivers: see gist.github.com/mjkvaak/5769ebdfbf6598b3fd0ece66b3c12a3c | |
# create conda environment | |
conda create --name myenv python=3.9 pip | |
conda activate myenv | |
# install cuda drivers | |
conda install -c anaconda cudatoolkit=11.3 | |
conda install -c conda-forge cudnn | |
# install tensorflow; change the version according to your preference | |
VERSION=2.7 | |
pip install --upgrade pip | |
pip install tensorflow==$VERSION keras==$VERSION | |
# confirm that installation was successfull | |
python -c "import tensorflow as tf; print(tf.__version__); print(tf.config.list_physical_devices('GPU'))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment