Closed cjl84914 closed 1 year ago
@cjl84914,
There are known issue in Windows related to 'pyyaml' and 'tf datasets' versions. As workaround, please follow the steps below:
Install *Python version "3.10." (tested with 3.10.11**).
Install the latest version of MediaPipe Model Maker using the command: pip install mediapipe-model-maker==0.2.1.3.
If you encounter an error like AttributeError: cython_sources, please resolve it by downgrading the pyyaml version
using the command: pip install pyyaml==5.3.1.
After downgrading pyyaml, attempt to install the MediaPipe Model Maker again using the command: pip install mediapipe-model-maker==0.2.1.3
. If all goes well, the installation should be successful as screenshot attached below:
Also, here's an example: If you're importingfrom mediapipe_model_maker import image_classifier,
as guided here. and you see an error like:
To fix this, just use the command:
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
I have tried command in python 3.10.11 env.
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.14.0 depends on tensorflow-text~=2.14.0 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
pip install pyyaml==5.3.1
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. datasets 2.12.0 requires aiohttp, which is not installed. datasets 2.12.0 requires huggingface-hub<1.0.0,>=0.11.0, which is not installed. datasets 2.12.0 requires numpy>=1.17, which is not installed. datasets 2.12.0 requires packaging, which is not installed. datasets 2.12.0 requires requests>=2.19.0, which is not installed. paddlenlp 2.5.2 requires colorama, which is not installed. paddlenlp 2.5.2 requires fastapi, which is not installed. paddlenlp 2.5.2 requires huggingface-hub>=0.11.1, which is not installed. paddleslim 2.4.1 requires pillow, which is not installed. ppdiffusers 0.14.1 requires Pillow, which is not installed. ppdiffusers 0.14.1 requires safetensors, which is not installed. Successfully installed pyyaml-5.3.1
I also encounter the same issue. Hoping to get it resolved here.
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.
@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!
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
Other info / Complete Logs
No response