google-research / text-to-text-transfer-transformer

Code for the paper "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer"
https://arxiv.org/abs/1910.10683
Apache License 2.0
6.18k stars 757 forks source link

New Colab Notebook Fails on First Cell (old version also fails with same response) #154

Closed ctmckee closed 4 years ago

ctmckee commented 4 years ago

Something appears to have changed with Colaboratory. Both your old notebook and new notebook produce the same error Module Not Found errors for two modules:

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-b742fbe2cadc>", line 11, in <module>
    import tensorflow.compat.v1 as tf
  File "/tensorflow-1.15.2/python3.6/tensorflow/__init__.py", line 50, in __getattr__
  File "/tensorflow-1.15.2/python3.6/tensorflow/__init__.py", line 44, in _load
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'tensorflow_core.compat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 1132, in get_records
    return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 313, in wrapped
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes
    records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/usr/lib/python3.6/inspect.py", line 1490, in getinnerframes
    frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
  File "/usr/lib/python3.6/inspect.py", line 1448, in getframeinfo
    filename = getsourcefile(frame) or getfile(frame)
  File "/usr/lib/python3.6/inspect.py", line 696, in getsourcefile
    if getattr(getmodule(object, filename), '__loader__', None) is not None:
  File "/usr/lib/python3.6/inspect.py", line 733, in getmodule
    if ismodule(module) and hasattr(module, '__file__'):
  File "/tensorflow-1.15.2/python3.6/tensorflow/__init__.py", line 50, in __getattr__
  File "/tensorflow-1.15.2/python3.6/tensorflow/__init__.py", line 44, in _load
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.keras'
ctmckee commented 4 years ago

I also ran !pip show tensorflow with output:

Name: tensorflow Version: 2.1.0 Summary: TensorFlow is an open source machine learning framework for everyone. Home-page: https://www.tensorflow.org/ Author: Google Inc. Author-email: packages@tensorflow.org License: Apache 2.0 Location: /usr/local/lib/python3.6/dist-packages Requires: numpy, protobuf, scipy, tensorflow-estimator, google-pasta, keras-applications, keras-preprocessing, gast, astor, opt-einsum, tensorboard, grpcio, absl-py, wheel, wrapt, termcolor, six Required-by: tensorflow-text, fancyimpute

adarob commented 4 years ago

We changed the version of tf in our pip package from 1.15 -> 2.x. You can see the changes you'll need to make to existing colabs in https://github.com/google-research/text-to-text-transfer-transformer/pull/152.