According to the TensorFlow Program's Guide (here), the following operations need TensorFlow 1.7
but I got an error (see below).
from __future__ import absolute_import, division, print_function
import tensorflow as tf
tf.enable_eager_execution()
Here is my set up.
I was doing this in Google Colab
, following the instruction on this page (link)
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
and then
!mkdir -p drive
!google-drive-ocamlfuse drive
and then
!pip install -q keras
and then using the instruction again from the TensorFlow Programmer's Guide
pip install --upgrade tensorflow
That should have upgraded to 1.7, but then I got the following error:
AttributeErrorTraceback (most recent call last)
<ipython-input-9-e1c25fd4f69c> in <module>()
1 from __future__ import absolute_import, division, print_function
2 import tensorflow as tf
----> 3 tf.enable_eager_execution()
AttributeError: 'module' object has no attribute 'enable_eager_execution'
Any suggestion?
Update
I just found out that I was still at TensorFlow 1.6
-- even after I tried the nightly build
print(tf.__version__)
1.6.0
Tried the nightly build
!pip install tf-nightly
print(tf.__version__)
1.6.0
So I guess my question is now this -- how do I upgrade to 1.7 in Google Colab
?