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
11.97k stars 2.03k forks source link

[BUG]: represent not working with facenet #1265

Closed lemnet closed 3 months ago

lemnet commented 3 months ago

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

DeepFace's version

0.0.92

Python version

3.12

Operating System

Ubuntu 24.04

Dependencies

tensorflow 2.16.1 keras 3.4.0

Reproducible example

embedding = DeepFace.represent(img_path = file,model_name = 'Facenet')

Relevant Log Output

error: libdevice not found at ./libdevice.10.bc 2024-06-25 17:45:44.871399: E tensorflow/compiler/mlir/tools/kernel_gen/tf_framework_c_interface.cc:207] INTERNAL: Generating device code failed.

[...]

tensorflow.python.framework.errors_impl.UnknownError: Exception encountered when calling layer 'Bottleneck_BatchNorm' (type BatchNormalization).

{{function_node wrappedRsqrtdevice/job:localhost/replica:0/task:0/device:GPU:0}} JIT compilation failed. [Op:Rsqrt] name:

Call arguments received by layer 'Bottleneck_BatchNorm' (type BatchNormalization): • inputs=tf.Tensor(shape=(1, 128), dtype=float32) • training=False • mask=None

Expected Result

No response

What happened instead?

No response

Additional Info

works with default model embedding = DeepFace.represent(img_path = file)

lemnet commented 3 months ago

My bad... deepface was not the issue ! export XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/lib/cuda solved my issue