tf-keras icon indicating copy to clipboard operation
tf-keras copied to clipboard

Showing warning just after importing tf_keras

Open kr-Ayaman opened this issue 1 year ago • 1 comments
trafficstars

when i run the code import tf_keras

the out output is

WARNING:tensorflow:From C:\Users\kumar\AppData\Local\Programs\Python\Python312\Lib\site-packages\tf_keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.

I am not even using tensorflow library but I still get this warning

kr-Ayaman avatar May 12 '24 08:05 kr-Ayaman

@kr-Ayaman, Apologies for the delay. Could you please confirm which version of tf-keras you are trying and the TensorFlow version as well. AFAIK it is possible that tf.compat.v1.losses.sparse_softmax_cross_entropy which calls the older tf.losses.sparse_softmax_cross_entropy and this causes the deprecation warning to trigger.

The deprecations are added as decorators, so they trigger at import time when the module is parsed and I suspect that is for the eager.

tilakrayal avatar May 20 '24 15:05 tilakrayal

I am using tf-keras version 2.16.0 and tensorflow version 2.16.1

kr-Ayaman avatar May 24 '24 15:05 kr-Ayaman

@kr-Ayaman, COuld you please let us know in which environment you are facing the mentioned warning? I tried in the colab and could not find the warning. Thank you!

tilakrayal avatar Jun 05 '24 08:06 tilakrayal

VS code

On Wed, Jun 5, 2024, 1:56 PM tilakrayal @.***> wrote:

@kr-Ayaman https://github.com/kr-Ayaman, COuld you please let us know in which environment you are facing the mentioned warning? I tried in the colab and could not find the warning. Thank you!

— Reply to this email directly, view it on GitHub https://github.com/keras-team/tf-keras/issues/778#issuecomment-2149193371, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCBQ6TISVRDEUSWMQ73RIW3ZF3DSTAVCNFSM6AAAAABHSUE2OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGE4TGMZXGE . You are receiving this because you were mentioned.Message ID: @.***>

kr-Ayaman avatar Jun 05 '24 09:06 kr-Ayaman

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Jun 20 '24 01:06 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar Jul 04 '24 01:07 github-actions[bot]