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

mediapipe protobuf #5897

Open
qwy1995 opened this issue Mar 11, 2025 · 2 comments
Open

mediapipe protobuf #5897

qwy1995 opened this issue Mar 11, 2025 · 2 comments
Assignees
Labels
gpu MediaPipe GPU related issues type:support General questions

Comments

@qwy1995
Copy link

qwy1995 commented Mar 11, 2025

I want to use tensorflow-gpu to accelerate the inference of mediapipe-hand in Windows 10 with Python 3.8. However, tensorflow-gpu only supports version 2.10 and requires protobuf<3.20, while the oldest version of mediapipe (0.10.5) requires protobuf>3.20. How can I install both mediapipe and tensorflow-gpu to use GPU acceleration for mediapipe inference? Does anyone have a lower version of mediapipe?

@qwy1995 qwy1995 added the type:others issues not falling in bug, perfromance, support, build and install or feature label Mar 11, 2025
@kuaashish kuaashish added type:support General questions gpu MediaPipe GPU related issues and removed type:others issues not falling in bug, perfromance, support, build and install or feature labels Mar 11, 2025
@dev-jatin-mehra
Copy link

#5897

if the problem still persists, then follow

Problem

You want to use tensorflow-gpu to accelerate the inference of mediapipe-hand in Windows 10 with Python 3.8. However, there is an incompatibility issue:

  • TensorFlow-GPU (<=2.10) requires protobuf<3.20
  • MediaPipe (>=0.10.5) requires protobuf>3.20

This conflict makes it difficult to install both packages together.


1. Use a Compatible MediaPipe Version (Manual Installation)

Older versions of mediapipe (<=0.8.10) are compatible with protobuf<3.20, making them a viable solution.

Steps to Install

  1. Create a new virtual environment:

    python -m venv mediapipe_env
    source mediapipe_env/bin/activate  # Linux/macOS
    mediapipe_env\Scripts\activate  # Windows
  2. Install TensorFlow-GPU (2.10):

    pip install tensorflow-gpu==2.10.0
  3. Install a compatible version of protobuf:

    pip install protobuf==3.19.6
  4. Install an older version of MediaPipe:

    pip install mediapipe==0.8.10.2
    • If this doesn’t work, try older versions (0.8.7, 0.8.9).

2. Use ONNX Runtime Instead of TensorFlow

If GPU acceleration is your main concern, an alternative is to convert the MediaPipe model to ONNX and use ONNX Runtime with GPU support.

Steps

  1. Convert MediaPipe models to ONNX:

    pip install tf2onnx
    python -m tf2onnx.convert --saved-model /path/to/model --output model.onnx
  2. Use ONNX Runtime GPU:

    pip install onnxruntime-gpu

@qwy1995
Copy link
Author

qwy1995 commented Mar 17, 2025

hello, thank you very much for your answer @dev-jatin-mehra . I have tried to install mediapipe==0.8.10.2 via pip install mediapipe==0.8.10.2 before (include mediapipe==0.8.x et.) but i failed. The error is :

ERROR: Could not find a version that satisfies the requirement mediapipe==0.8.10.2 (from versions: 0.10.5, 0.10.7, 0.10.8, 0.10.9, 0.10.10, 0.10.11)
ERROR: No matching distribution found for mediapipe==0.8.10.2

so maybe cannot try older versions, the oldest version is 0.10.5, or do you have the package *.whl files about older versions. Looking forward to hearing from you, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpu MediaPipe GPU related issues type:support General questions
Projects
None yet
Development

No branches or pull requests

3 participants