tensor2tensor
tensor2tensor copied to clipboard
https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/hello_t2t.ipynb not working on Google Colab
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.
...
execute the command !pip install tensorflow-datasets==1.0.1
added the command to first cell and now cell 2 seems to be working, thanks!
De: tzone @.> Enviado: domingo, 26 de septiembre de 2021 06:50 p. m. Para: tensorflow/tensor2tensor @.> CC: Juan Carlos Ramirez @.>; Author @.> Asunto: Re: [tensorflow/tensor2tensor] https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/hello_t2t.ipynb not working on Google Colab (#1898)
execute the command !pip install tensorflow-datasets==1.0.1
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftensorflow%2Ftensor2tensor%2Fissues%2F1898%23issuecomment-927442325&data=04%7C01%7C%7C2cd7e1c74d5b48aef21a08d981592794%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683042218228075%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=G2nWy7NrGR9XdDnVaizBHeBl7HSHw%2FSWPcmT%2FYaDZYg%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGDJUUVGS25EOUXMLKRHCY3UD7EVPANCNFSM5EWQEFTA&data=04%7C01%7C%7C2cd7e1c74d5b48aef21a08d981592794%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683042218238077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tFVBzSdcjLVP1puBIxWi32TP4KXzukF4TUN5kpsrFs8%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C2cd7e1c74d5b48aef21a08d981592794%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683042218238077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6tlmGPbn3n0UPN5QIN3THXaYIN8n6w1eh2ptwNofX0o%3D&reserved=0 or Androidhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7C%7C2cd7e1c74d5b48aef21a08d981592794%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637683042218248068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CJidSZhf4fhnNpgHwcUpdrdo8qibUMCwA8tE8YGlzKQ%3D&reserved=0.