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

[BUG] tensorflow-estimator is removed from tensorflow 2.16.1 #2072

Open
SimonYansenZhao opened this issue Mar 19, 2024 · 5 comments
Open

[BUG] tensorflow-estimator is removed from tensorflow 2.16.1 #2072

SimonYansenZhao opened this issue Mar 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@SimonYansenZhao
Copy link
Collaborator

Description

As mentioned in TensorFlow's release note for version 2.16.1, the breaking change that removes tensorflow-estimator is complete in TensorFlow 2.16.1. All code using TF estimator in Recommenders needs to change.

In which platform does it happen?

TensorFlow

How do we replicate the issue?

Expected behavior (i.e. solution)

Other Comments

@daviddavo
Copy link
Collaborator

This is needed to update to Python 3.12

I don't know anything about tensorflow and I'm having problems solving this issue. If someone can and wants to help, I did a mini-guide on the problem.

@miguelgfierro
Copy link
Collaborator

@daviddavo it would be good to know exactly what code is affected. Maybe there is a way to change these piece of code to change it. Also, we need to consider that we have some algos that we are going to change by a PyTorch version see #2111

@daviddavo
Copy link
Collaborator

Basically, the entirety of the wide_deep_utils.py file.

I haven't really used tensorflow, so I don't know exactly how it works, but this doesn't seem to be a minor change as it needs a complete refactoring to use tf.keras. For example, tf.estimator.RunConfig doesn't exist anymore and you need to create some callbacks: one for saving checkpoints, one for logging, etc. that may or may not be already available in the library. Each of the three models (wide, deep and wide-deep) would also need to be redone using tf.keras models.

The functions used by wide_deep but defined in tf_utils.py. There are some functions that would need to be created, and others that would be deleted:

Perhaps using keras 3 (backend agnostic) or Pytorch would take a similar effort to migrating to tf.keras.

@miguelgfierro
Copy link
Collaborator

If only wide and deep is affected, would it be easier to replace it with PyTorch? Here's an implementation: https://www.kaggle.com/code/matanivanov/wide-deep-learning-for-recsys-with-pytorch

I think TF W&D was done by @loomlike. What do you suggest?

@daviddavo
Copy link
Collaborator

I was giving it a go because I want to learn a bit more about low-level machine learning (instead of always using import), and it seems that tf.feature_column is also deprecated.

Keras 3 allows using multiple backends, TensorFlow and PyTorch, both included. It does not support Python 3.8, which is still the second most used version of Python to download the recommenders package. Nevertheless, it's just a mere 5% of the downloads (note: in july it was 10% so its rapidly declining). Perhaps the python312 branch (#2098) should stop supporting Python 3.8 and be merged when less than X% of users use python 3.8. Users that still need it can always download an old version of the recommenders package from pypi.

About using PyTorch, it would be less straightforward and would require making substantial changes to some of the notebooks, but its syntax is easier to understand. I will give it a go directly from the paper and the notebook because refactoring from tf to PyTorch is impossible due to their vast diferences in software architectures and paradigms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants