Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to install tensorflow version 1.14 in Google colab but failed

I need to test a code in Google colab which is not supported in tf2(for tf.ceil is not supported in tf2), so I want to install tensorflow in version 1.14. I use pip3 and pip to install tensorflow, all of them install tf successfully, but as I do this:

import tensorflow as tf
tf.__version__

It returns:

'2.2.0-rc3'

And I have clear sys.path:

import sys
sys.path

It returns:

[]

How can I install tensorflow in version 1.14?

like image 925
tao liang Avatar asked Dec 22 '22 18:12

tao liang


1 Answers

The easiest way to ensure you work with TF v1 is to simply run the

%tensorflow_version 1.x

line before you import TensorFlow.

Colab already builds TF from source so Google recommends against using pip to install TF as you may incur performance problems.

like image 87
dreamwalkeranderson Avatar answered Jan 01 '23 09:01

dreamwalkeranderson