serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
10.85k stars 1.91k forks source link

[BUG]: tensorflow deprecation warning with tf-keras #1220

Closed Invizabel closed 2 months ago

Invizabel commented 2 months ago

Before You Report a Bug, Please Confirm You Have Done The Following...

DeepFace's version

deepface==0.0.90

Python version

3.12.3

Operating System

Windows 11

Dependencies

tf_keras==2.16.0 tensorflow==2.16.1 tensorflow-intel==2.16.1

Reproducible example

result = DeepFace.verify(image_1, image_2)

data = np.array(Image.open(io.BytesIO(requests.get(host).content)))
result = DeepFace.verify(local_image, data)

Relevant Log Output

WARNING:tensorflow:From C:\Users\inviz\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\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.

Expected Result

it not being deprecated

What happened instead?

tf.losses.sparse_softmax_cross_entropy is deprecated

Additional Info

I'm passing these images in as a numpy array as I'm retrieving them with the requests library. I'm not sure if this makes a difference. It still returns the correct answer with all defaults

serengil commented 2 months ago

It is a warning not bug!