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

Unexpected depreciation warning in tensorflow 2.16.1 #19811

Open
whichedge opened this issue Jun 6, 2024 · 3 comments
Open

Unexpected depreciation warning in tensorflow 2.16.1 #19811

whichedge opened this issue Jun 6, 2024 · 3 comments

Comments

@whichedge
Copy link

whichedge commented Jun 6, 2024

Python 3.12
tensorflow 2.16.1
keras 3.3.3
Windows 11

I have just updated to tensorflow 2.16.1 and am going through my code checking of compatablity. When I import my tensorflow code I get the warning:

**WARNING:tensorflow:From \venv\Lib\site-packages\keras\src\backend\common\global_state.py:82: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.

The warning points to line 82 in global_state.py in the keras backend, which uses the correct statement (tf.compat.v1.reset_default_graph). I have pin pointed this warning coming from my use of keras.backend.clear_session().

Is this warning valid? Because from what I can see the depreciated tf.reset_default_graph is not used

EDIT: I have got my tensorflow code running and so far it seems to be work without giving any errors....it has called the keras.backend.clear_session() several times and no errors.

@sachinprasadhs
Copy link
Collaborator

I'm not able to notice the warning in the latest TensorFlow version when the keras.backend.clear_session() is used, Keras uses tf.compat.v1.reset_default_graph in the code as mentioned below

tf.compat.v1.reset_default_graph()

@whichedge
Copy link
Author

As I couldn't find a reason for the warning either, that's why I raised the issue, it's probably my installation, in the next couple of weeks I'll be transfering the code to a Linux machine, I'll see what happens and report back.
In the mean time how do I supress this warning? It's filling my console with red text!

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

2 participants