Skip to content

Instantly share code, notes, and snippets.

@antojoseph
Last active May 8, 2020 14:54
Show Gist options
  • Save antojoseph/1d6a5f5b00c5924b591557e9d5d167f9 to your computer and use it in GitHub Desktop.
Save antojoseph/1d6a5f5b00c5924b591557e9d5d167f9 to your computer and use it in GitHub Desktop.
#import tensorflow 1.x as this is required for older codebases,don't forget to restart the runtime
%tensorflow_version 1.x
print('Tensorflow version: {}'.format(tf.__version__) )
#sometimes, you need a specific version of tensorflow,for eg: stylegan
%tensorflow_version 2.x
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
#Select GPU as the accelarator for this to work!
!nvidia-smi -L
#Location of GPU device
print('GPU Identified at: {}'.format(tf.test.gpu_device_name()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment