Currently google colaboratory uses tensorflow 1.4.1. I want to upgrade it to 1.5.0 version. Each time when i executed !pip install --upgrade tensorflow
command, notebook instance succesfully upgrades the tensorflow version to 1.5.0. But after upgrade operation tensorflow instance only supports "CPU".
When i have executed this command it shows nothing :
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
Should there be another way for upgrading tensorflow ? such as upgrading to tensorflow-gpu package ? Also when will notebooks will come with upgraded tensorflows ?
To check your TensorFlow version in your Jupyter Notebook such as Google's Colab, use the following two commands: import tensorflow as tf This imports the TensorFlow library and stores it in the variable named tf . print(tf. __version__) This prints the installed TensorFlow version number in the format x.y.z .
As of 2020, Colab can run Tensorflow 2.0. Uninstall the current version of Tensorflow:
!pip uninstall tensorflow
and simply reinstall using pip.
!pip install tensorflow==2.0.0
If you so choose, you can also install the beta version with
!pip install tensorflow==2.0.0-beta1
Once you've reinstalled Tensorflow, make sure you don't forget to restart the runtime under the Runtime tab.
A native solution is to start your code with
%tensorflow_version 2.x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With