mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Dependency error with protobuf (?)

Open dayadim opened this issue 1 year ago • 1 comments

OS Platform and Distribution

Windows 11

Compiler version

No response

Programming Language and version

Python 3.10.14, 3.10.15

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

Conda

MediaPipe version

0.10.14

Bazel version

No response

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)

No response

Describe the problem

No overlap between protobuf version with mediapipe and tensorflow, despite having it working on another system?

Complete Logs

Using pip, i installed tensorflow 2.10.1 and mediapipe 0.10.14 with no issue onto a virtual conda environment. This was roughly a month ago.

Now, i'm trying to recreate this environment on another system. Same tensorflow version, same mediapipe version.

Pip's error message:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mediapipe 0.10.14 requires protobuf<5,>=4.25.3, but you have protobuf 3.20.3 which is incompatible.
tensorboard 2.10.1 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.3 which is incompatible.
tensorflow 2.10.1 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.3 which is incompatible.
Successfully installed protobuf-3.20.3


Basically, importing mediapipe results in this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 import mediapipe

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\__init__.py:17
     15 from mediapipe.python import *
     16 import mediapipe.python.solutions as solutions 
---> 17 import mediapipe.tasks.python as tasks
     20 del framework
     21 del gpu

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\tasks\python\__init__.py:17
      1 # Copyright 2022 The MediaPipe Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     15 """MediaPipe Tasks API."""
---> 17 from . import audio
     18 from . import components
     19 from . import core

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\tasks\python\audio\__init__.py:18
     15 """MediaPipe Tasks Audio API."""
     17 import mediapipe.tasks.python.audio.core
---> 18 import mediapipe.tasks.python.audio.audio_classifier
     19 import mediapipe.tasks.python.audio.audio_embedder
     21 AudioClassifier = audio_classifier.AudioClassifier

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\tasks\python\audio\audio_classifier.py:26
     24 from mediapipe.tasks.cc.components.processors.proto import classifier_options_pb2
     25 from mediapipe.tasks.python.audio.core import audio_task_running_mode as running_mode_module
---> 26 from mediapipe.tasks.python.audio.core import base_audio_task_api
     27 from mediapipe.tasks.python.components.containers import audio_data as audio_data_module
     28 from mediapipe.tasks.python.components.containers import classification_result as classification_result_module

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\tasks\python\audio\core\base_audio_task_api.py:24
     22 from mediapipe.python._framework_bindings import timestamp as timestamp_module
     23 from mediapipe.tasks.python.audio.core import audio_task_running_mode as running_mode_module
---> 24 from mediapipe.tasks.python.core.optional_dependencies import doc_controls
     26 _TaskRunner = task_runner_module.TaskRunner
     27 _Packet = packet_module.Packet

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\mediapipe\tasks\python\core\optional_dependencies.py:20
     16 # TensorFlow isn't a dependency of mediapipe pip package. It's only
     17 # required in the API docgen pipeline so we'll ignore it if tensorflow is not
     18 # installed.
     19 try:
---> 20   from tensorflow.tools.docs import doc_controls
     21 except ModuleNotFoundError:
     22   # Replace the real doc_controls.do_not_generate_docs with an no-op
     23   doc_controls = lambda: None

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\__init__.py:37
     34 import sys as _sys
     35 import typing as _typing
---> 37 from tensorflow.python.tools import module_util as _module_util
     38 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
     40 # Make sure code inside the TensorFlow codebase can use tf2.enabled() at import.

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\__init__.py:42
     37 from tensorflow.python.eager import context
     39 # pylint: enable=wildcard-import
     40 
     41 # Bring in subpackages.
---> 42 from tensorflow.python import data
     43 from tensorflow.python import distribute
     44 # from tensorflow.python import keras

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\__init__.py:21
     15 """`tf.data.Dataset` API for input pipelines.
     16 
     17 See [Importing Data](https://tensorflow.org/guide/data) for an overview.
     18 """
     20 # pylint: disable=unused-import
---> 21 from tensorflow.python.data import experimental
     22 from tensorflow.python.data.ops.dataset_ops import AUTOTUNE
     23 from tensorflow.python.data.ops.dataset_ops import Dataset

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\experimental\__init__.py:96
     15 """Experimental API for building input pipelines.
     16 
     17 This module contains experimental `Dataset` sources and transformations that can
   (...)
     92 @@UNKNOWN_CARDINALITY
     93 """
     95 # pylint: disable=unused-import
---> 96 from tensorflow.python.data.experimental import service
     97 from tensorflow.python.data.experimental.ops.batching import dense_to_ragged_batch
     98 from tensorflow.python.data.experimental.ops.batching import dense_to_sparse_batch

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\experimental\service\__init__.py:419
      1 # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     13 # limitations under the License.
     14 # ==============================================================================
     15 """API for using the tf.data service.
     16 
     17 This module contains:
   (...)
    416   job of ParameterServerStrategy).
    417 """
--> 419 from tensorflow.python.data.experimental.ops.data_service_ops import distribute
    420 from tensorflow.python.data.experimental.ops.data_service_ops import from_dataset_id
    421 from tensorflow.python.data.experimental.ops.data_service_ops import register_dataset

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\experimental\ops\data_service_ops.py:24
     22 from tensorflow.python import tf2
     23 from tensorflow.python.compat import compat
---> 24 from tensorflow.python.data.experimental.ops import compression_ops
     25 from tensorflow.python.data.experimental.service import _pywrap_server_lib
     26 from tensorflow.python.data.experimental.service import _pywrap_utils

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\experimental\ops\compression_ops.py:16
      1 # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
   (...)
     13 # limitations under the License.
     14 # ==============================================================================
     15 """Ops for compressing and uncompressing dataset elements."""
---> 16 from tensorflow.python.data.util import structure
     17 from tensorflow.python.ops import gen_experimental_dataset_ops as ged_ops
     20 def compress(element):

File c:\Users\Amaan\anaconda3\envs\py310_SD\lib\site-packages\tensorflow\python\data\util\structure.py:23
     20 import six


It still seems that the versions I have on my desktop are working, but cannot be replicated in any way. Seeing that there was another issue with mediapipe and a protobuf version, I'm starting here.

dayadim avatar Oct 15 '24 02:10 dayadim