google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.42k stars 5.15k forks source link

Windows update mediapipe-model-maker lastest ver issue #4858

Closed cjl84914 closed 1 year ago

cjl84914 commented 1 year ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

Win10

Python Version

Python 3.9.13

MediaPipe Model Maker version

mediapipe-model-maker==0.2.1.3

Task name (e.g. Image classification, Gesture recognition etc.)

pip install mediapipe-model-maker==0.2.1.3

Describe the actual behavior

ERROR: Cannot install mediapipe-model-maker because these package versions have conflicting

Describe the expected behaviour

install success

Standalone code/steps you may have used to try to get what you need

I try to update mediapipe-model-maker lastest ver.
run:
pip install mediapipe-model-maker==0.2.1.3
ERROR: Cannot install mediapipe-model-maker because these package versions have conflicting dependencies. The conflict is caused by: tf-models-official 2.13.2 depends on tensorflow-text~=2.13.0 tf-models-official 2.13.1 depends on tensorflow-text~=2.13.0 
next run:
pip install tensorflow-text==2.13.0
ERROR: Could not find a version that satisfies the requirement tensorflow-text==2.13.0 (from versions: 2.5.0, 2.6.0rc0, 2.6.0, 2.7.0rc0, 2.7.0rc1, 2.7.3, 2.8.0rc0, 2.8.1, 2.8.2, 2.9.0rc0, 2.9.0rc1, 2.9.0, 2.10.0b2, 2.10.0rc0, 2.10.0) ERROR: No matching distribution found for tensorflow-text==2.13.0

Other info / Complete Logs

No response

kuaashish commented 1 year ago

@cjl84914,

There are known issue in Windows related to 'pyyaml' and 'tf datasets' versions. As workaround, please follow the steps below:

Screenshot 2023-10-06 at 7 03 42 PM

Also, here's an example: If you're importingfrom mediapipe_model_maker import image_classifier, as guided here. and you see an error like:

Screenshot 2023-10-06 at 7 31 13 PM

To fix this, just use the command:

Screenshot 2023-10-06 at 7 31 26 PM

Don't worry about any warning messages that show up after installing MediaPipe Model Maker. Also, please inform us if these steps resolve the issues you were facing. Thank you

cjl84914 commented 1 year ago

I have tried command in python 3.10.11 env.

lamteteeow commented 1 year ago

image

I also encounter the same issue. Hoping to get it resolved here.

joezoug commented 1 year ago

Hi @cjl84914 and @lamteteeow,

Unfortunately tensorflow-text stopped supporting windows since version 2.11 - see https://github.com/tensorflow/text/issues/1140 and https://github.com/tensorflow/text#a-note-about-different-operating-system-packages. You can try building the tensorflow-text package from their Github if you need to run this on Windows.

If you are not using the text_classifier task in Model Maker(which requires tensorflow-text), then you may also try to install using pip with the --no-deps parameter. You would need to install each of the requirements except for tensorflow-text independently. It seems like this was a hacky solution proposed by a user here: https://github.com/tensorflow/text/issues/1206.

Alternatively, you can try using Windows Subsystem for Linux(WSL) or the Colab cloud environment to install these packages in a Linux environment.

cjl84914 commented 1 year ago

@lamteteeow @kuaashish @joezoug Thank you very much! Fortunately, I have resolved the issues, using Windows Subsystem for Linux(WSL). step1 install wsl: https://learn.microsoft.com/zh-cn/windows/wsl/install step2 install cuda:

wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

step3 install cudnn:

sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.4.25_1.0-1_amd64.deb
sudo cp /var/cudnn-local-repo-ubuntu2204-8.9.4.25/cudnn-local-72322D7F-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt -y install libcudnn8 libcudnn8-dev

step4 install anaconda: Omit this step step5 install mediapipe:

pip install mediapipe-model-maker==0.2.1.3

Detailed: https://zhuanlan.zhihu.com/p/621142457?utm_id=0 Wish help other who facing same issue!

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No