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

Face mesh build error #5714

Open
Hemanth-TS opened this issue Nov 3, 2024 · 5 comments
Open

Face mesh build error #5714

Hemanth-TS opened this issue Nov 3, 2024 · 5 comments
Assignees
Labels
legacy:face mesh Issues related to Face Mesh os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. platform:python MediaPipe Python issues stat:awaiting googler Waiting for Google Engineer's Response type:build/install For Build and Installation issues

Comments

@Hemanth-TS
Copy link

OS Platform and Distribution

Ubuntu 20.04

Compiler version

No response

Programming Language and version

python 3.9

Installed using virtualenv? pip? Conda?(if python)

conda

MediaPipe version

0.10.14

Bazel version

7.4

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

4.8.0

Describe the problem

Build error

Complete Logs

I was trying to build face_mesh using cuda for gpu support ,
 
"CUDA_TOOLKIT_PATH="/usr/local/cuda" HERMETIC_CUDNN_VERSION="8.6" bazel build -c opt --config=cuda //mediapipe/examples/desktop/face_mesh:face_mesh_gpu"

I ran into the following error 
Starting local Bazel server and connecting to it...
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/py/python_repo.bzl:96:14: 
HERMETIC_PYTHON_VERSION variable was not set correctly, using default version.
Python 3.9 will be used.
To select Python version, either set HERMETIC_PYTHON_VERSION env variable in
your shell:
  export HERMETIC_PYTHON_VERSION=3.12
OR pass it as an argument to bazel command directly or inside your .bazelrc
file:
  --repo_env=HERMETIC_PYTHON_VERSION=3.12
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/py/python_repo.bzl:107:10: Using hermetic Python 3.9
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'XNNPACK' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'zlib' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'rules_android_ndk' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'pybind11_protobuf' because it already exists.
DEBUG: /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/repo.bzl:132:14: 
Warning: skipping import of repository 'com_github_glog_glog' because it already exists.
INFO: Repository cuda_cudnn instantiated at:
  /home/ipcam/Downloads/face_recog/Drowsiness-Detection-Mediapipe/mediapipe/WORKSPACE:644:29: in <toplevel>
  /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl:514:15: in cudnn_redist_init_repository
Repository rule cudnn_repo defined at:
  /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl:434:29: in <toplevel>
ERROR: An error occurred during the fetch of repository 'cuda_cudnn':
   Traceback (most recent call last):
	File "/home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl", line 432, column 45, in _cudnn_repo_impl
		_use_downloaded_cudnn_redistribution(repository_ctx)
	File "/home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl", line 394, column 35, in _use_downloaded_cudnn_redistribution
		version = cuda_version.split(".")[0],
Error: 'NoneType' value has no field or method 'split'
ERROR: /home/ipcam/Downloads/face_recog/Drowsiness-Detection-Mediapipe/mediapipe/WORKSPACE:644:29: fetching cudnn_repo rule //external:cuda_cudnn: Traceback (most recent call last):
	File "/home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl", line 432, column 45, in _cudnn_repo_impl
		_use_downloaded_cudnn_redistribution(repository_ctx)
	File "/home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/third_party/gpus/cuda/hermetic/cuda_redist_init_repositories.bzl", line 394, column 35, in _use_downloaded_cudnn_redistribution
		version = cuda_version.split(".")[0],
Error: 'NoneType' value has no field or method 'split'
ERROR: /home/ipcam/Downloads/face_recog/Drowsiness-Detection-Mediapipe/mediapipe/mediapipe/examples/desktop/face_mesh/BUILD:38:10: error loading package 'mediapipe/modules/face_landmark': at /home/ipcam/Downloads/face_recog/Drowsiness-Detection-Mediapipe/mediapipe/mediapipe/framework/tool/mediapipe_graph.bzl:26:6: at /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/tensorflow/lite/core/shims/cc_library_with_tflite.bzl:6:6: at /home/ipcam/.cache/bazel/_bazel_ipcam/be4e6a33c6a81d7c2f02001ee40b651b/external/org_tensorflow/tensorflow/tensorflow.bzl:13:5: Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': no such package '@cuda_cudnn//': 'NoneType' value has no field or method 'split' and referenced by '//mediapipe/examples/desktop/face_mesh:face_mesh_gpu'
ERROR: Analysis of target '//mediapipe/examples/desktop/face_mesh:face_mesh_gpu' failed; build aborted: Analysis failed
INFO: Elapsed time: 4.837s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (50 packages loaded, 249 targets configured)
    currently loading: mediapipe/modules/face_landmark ... (2 packages)
    Fetching repository @local_config_cc; starting
    Fetching repository @local_config_cuda; Restarting.
"
@Hemanth-TS Hemanth-TS added the type:build/install For Build and Installation issues label Nov 3, 2024
@kuaashish kuaashish assigned kuaashish and unassigned ayushgdev Nov 4, 2024
@kuaashish kuaashish added os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. python Pull requests that update Python code legacy:face mesh Issues related to Face Mesh labels Nov 4, 2024
@kuaashish
Copy link
Collaborator

Hi @Hemanth-TS,

Could you first confirm if you are able to run the "Hello World" example provided here? Also, it appears that Bazel version 7.4 is currently being used, while version 6.5.0 is the supported version. Please update Bazel to the supported version, then let us know the status.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Nov 5, 2024
@Hemanth-TS
Copy link
Author

Hemanth-TS commented Nov 6, 2024

I’ve modified the configuration and am now using:

Python 3.8
Bazel 6.1.1
MediaPipe 0.10.13
I successfully ran the Hello World example, and now I'm working with a Python script that utilizes the Face Mesh model. I want to ensure it's utilizing my T4 GPU properly. Could you guide me on how to set this up?

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Nov 6, 2024
@kuaashish
Copy link
Collaborator

Hi @schmidt-sebastian,

Do you have any suggestions on the above query?

Thank you!!

@kuaashish kuaashish added the stat:awaiting googler Waiting for Google Engineer's Response label Nov 6, 2024
@Hemanth-TS
Copy link
Author

Ultimately what i need to do now is
-Enable CUDA support for face-mesh.
-Run multiple Python scripts utilizing CUDA-enabled face-mesh.

Previously, I referred to https://ai.google.dev/edge/mediapipe/framework/getting_started/gpu_support, the sections on TensorFlow and CUDA support.

@Hemanth-TS
Copy link
Author

@kuaashish @schmidt-sebastian could either of you follow up on this?

@kuaashish kuaashish added platform:python MediaPipe Python issues and removed python Pull requests that update Python code labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:face mesh Issues related to Face Mesh os:linux-non-arm Issues on linux distributions which run on x86-64 architecture. DOES NOT include ARM devices. platform:python MediaPipe Python issues stat:awaiting googler Waiting for Google Engineer's Response type:build/install For Build and Installation issues
Projects
None yet
Development

No branches or pull requests

4 participants