Skip to content

Instantly share code, notes, and snippets.

@cybertramp
Last active October 7, 2019 02:56
Show Gist options
  • Select an option

  • Save cybertramp/91e14ffd38e37466bd0988e794fba90e to your computer and use it in GitHub Desktop.

Select an option

Save cybertramp/91e14ffd38e37466bd0988e794fba90e to your computer and use it in GitHub Desktop.
ipython tensorflow2 version check script
# Tensorflow version check & upgrade
# Written by paran_son@outlook.com
# Updated 19.09.23
%%bash
var=`python3 -c 'import tensorflow as tf; print(tf.__version__)'`
if [ "${var:0:1}" = "2" ];then
echo "version2"
else
echo "version1"
pip uninstall tensorflow -y
pip uninstall tensorflow-gpu -y
pip install tensorflow-gpu==2.0.0-beta1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment