Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.
This repository was 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

@jramirezpr

Description

@jramirezpr

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.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions