Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFX cannot be installed in Colab since Colab runs on Python 3.10 #5897

Closed
tanguycdls opened this issue May 9, 2023 · 20 comments
Closed

TFX cannot be installed in Colab since Colab runs on Python 3.10 #5897

tanguycdls opened this issue May 9, 2023 · 20 comments

Comments

@tanguycdls
Copy link

If the bug is related to a specific library below, please raise an issue in the
respective repo directly:

TensorFlow Data Validation Repo

TensorFlow Model Analysis Repo

TensorFlow Transform Repo

TensorFlow Serving Repo

System information

  • Have I specified the code to reproduce the issue (Yes, No): yes
    !pip install tfx==1.13.0
  • Environment in which the code is executed (e.g., Local(Linux/MacOS/Windows),
    Interactive Notebook, Google Cloud, etc):
    colab
  • TensorFlow version:
  • TFX Version: 1.13
  • Python version:
  • Python dependencies (from pip freeze output):

Describe the current behavior
TFX requires python up to 3.9, while colab runs on Python 3.10.
Describe the expected behavior
Be able to install TFX on colab.
Standalone code to reproduce the issue
!pip install tfx==1.13.0

Providing a bare minimum test case or step(s) to reproduce the problem will
greatly help us to debug the issue. If possible, please share a link to
Colab/Jupyter/any notebook.

Name of your Organization (Optional)
Tinyclues / Splio

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem.
If including tracebacks, please include the full traceback. Large logs and files
should be attached.

@singhniraj08 singhniraj08 self-assigned this May 10, 2023
@singhniraj08
Copy link
Contributor

@tanguycdls,

We are aware of this issue and working on bumping up the python release to 3.10 for TFX. Meanwhile we tried a workaround of downgrading python version in colab environment but it fails once we restart the notebook. We will update this thread once we have an update. Thank you!

@singhniraj08
Copy link
Contributor

@tanguycdls,

Meanwhile we are upgrading python support to 3.10, you can try using fallback runtime version to run the TFX tutorials. To enable that, once colab runtime is connected, You can use key combination (Ctrl + Shift + P) and type "Use fallback runtime version" and select it to use Python 3.9.16 version runtime. This is allow you to run TFX examples on fallback runtime.
Thanks.

@tanguycdls
Copy link
Author

Helo @singhniraj08 thanks it works ! how long this fallback runtime is kept by Colab ?

@AnuarTB
Copy link
Contributor

AnuarTB commented May 10, 2023

Wow, I didn't know about this feature. Thank you @singhniraj08! I will try to put out this tip on the tutorials website as well, after checking.

@AnuarTB
Copy link
Contributor

AnuarTB commented May 10, 2023

CC: @rcrowe-google

This might be our temporary solution while we are migrating the libraries to Python 3.10.

@singhniraj08
Copy link
Contributor

@AnuarTB, @tanguycdls,

As per this issue #colabtools/3572, the the fallback runtime version is available until mid-May.

@AnuarTB
Copy link
Contributor

AnuarTB commented May 22, 2023

We are currently migrating everything, but the timeline is still not very clear. Will update if we find something new.

@GaneshACN
Copy link

any fix / progress about this Python 3.10 error for TFX DV library?

@rcrowe-google
Copy link
Contributor

As a short term fix, this page has instructions for reverting to Python 3.8.3:

https://www.tensorflow.org/tfx/tutorials

@tanduong
Copy link

tanduong commented Aug 3, 2023

Do we have an update on this issue?

@AnuarTB
Copy link
Contributor

AnuarTB commented Aug 4, 2023

We are actively working on migration. Unfortunately we cannot give definite ETA, but right now it is our most prioritized item to migrate TFX to Python 3.10.

@singhniraj08
Copy link
Contributor

@tanguycdls,

Python 3.10 support is introduced in TFX 1.14.0 Release. Simply pip install tfx in colab should install TFX without any issues in Colab.
Please let us know if you have any issues. Thank you!

@github-actions
Copy link
Contributor

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Sep 15, 2023
@AnuarTB
Copy link
Contributor

AnuarTB commented Sep 15, 2023

As Python 3.10 is supported I am closing this issue.

@AnuarTB AnuarTB closed this as completed Sep 15, 2023
@github-actions
Copy link
Contributor

Are you satisfied with the resolution of your issue?
Yes
No

@raminmohammadi
Copy link

This issue still happens on colab with runtime Python 3.10.12, I am able to install TFX using pip install tfx. However, uppon importing tfx i get

`Using TensorFlow backend

ImportError Traceback (most recent call last)
in <cell line: 6>()
4 from absl import logging
5
----> 6 from tfx import v1 as tfx
7 from tfx.proto import example_gen_pb2, trainer_pb2
8 from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext

4 frames
/usr/local/lib/python3.10/dist-packages/tfx/components/tuner/executor.py in
20 from absl import logging
21 from keras_tuner.engine import base_tuner
---> 22 from keras_tuner.engine import trial
23 from tfx import types
24 from tfx.components.trainer import fn_args_utils

ImportError: cannot import name 'trial' from 'keras_tuner.engine' (/usr/local/lib/python3.10/dist-packages/keras_tuner/engine/init.py)


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

Link to the colab: https://colab.research.google.com/drive/1ap8Gycu7s--mz0VAxp4W2DphAd1HW1yi?usp=sharing

@singhniraj08
Copy link
Contributor

@raminmohammadi,

I am able to replicate this issue and the issue is because of keras-tuner package which fails to import from keras_tuner.engine import trial.
We are working on this issue. Meanwhile, you can degrade the keras-tuner version to make the tutorial work. Add the below lines of code after installing TFX in Colab. Thanks.

!pip uninstall keras-tuner
!pip install keras-tuner==1.3.5

@rcrowe-google
Copy link
Contributor

The 1.4.2 release of Keras Tuner is now available on PyPI. Could you see if that fixes the problem for you?

@rcrowe-google rcrowe-google reopened this Sep 26, 2023
@raminmohammadi
Copy link

@rcrowe-google it solved the problem.

@github-actions
Copy link
Contributor

Are you satisfied with the resolution of your issue?
Yes
No

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

No branches or pull requests

7 participants