Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/hello_t2t.ipynb not working on Google Colab #1898

Open
jramirezpr opened this issue Sep 24, 2021 · 2 comments

Comments

@jramirezpr
Copy link

jramirezpr commented Sep 24, 2021

Description

When running Cells on google Colab, second cell gives error

Environment information

google colab

OS: Linux

$ pip freeze | grep tensor
# your output here

$ python -V
# your output here

For bugs: reproduction and error logs

Steps to reproduce:

If one takes out

if 'google.colab' in sys.modules: # Colab-only TensorFlow version selector
  %tensorflow_version 1.x

and restarts runtime and runs
the import error dissapears, but errors regarding attributes unavailable in tf1 appear (e.g. tf1.contrib.eager)

The import error on cell 2 is

ImportError                               Traceback (most recent call last)

<ipython-input-2-00e41dd9537e> in <module>()
      9 import collections
     10 
---> 11 from tensor2tensor import models
     12 from tensor2tensor import problems
     13 from tensor2tensor.layers import common_layers

7 frames

/usr/local/lib/python3.7/dist-packages/tensorflow_datasets/core/tf_compat.py in ensure_tf_install()
     57   if tf_version < min_tf_version:
     58     raise ImportError(
---> 59         "This version of TensorFlow Datasets requires TensorFlow "
     60         f"version >= {MIN_TF_VERSION}; Detected an installation of version "
     61         f"{tf.__version__}. Please upgrade TensorFlow to proceed."

ImportError: This version of TensorFlow Datasets requires TensorFlow version >= 2.1.0; Detected an installation of version 1.15.2. Please upgrade TensorFlow to proceed.


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
...
@taoztw
Copy link

taoztw commented Sep 27, 2021

execute the command !pip install tensorflow-datasets==1.0.1

@jramirezpr
Copy link
Author

jramirezpr commented Sep 28, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants