tensorflow: tflite-model-maker cannot be installed correctly for different reasons on different configurations
If you try to install tflite-model-maker-nightly basically it starts to download all nightly build wheels since the first release rather than latest one as supposed.
This seems caused by a bad configuration. Many people have reported this issue many months ago, it remained unsolved as this other issue.
But they aren’t the only setup issues that affects tflite-model-maker.
If you try to install the latest build with pip install tflite-model-maker it raises various errors
e.g.
tflite-support dependency that hasn’t any wheel available in repository (for windows since the 0.4.0 released in May 2022 there is no wheel at all and the latest is 0.3.1 that has no wheel for latest Python versions).
Tried on Linux arm64 and needed wheels are missing too.
How is decided to upgrade version dependencies requirements without release updated dependencies coherently, considering these are developed by same company?
If it isn’t followed a coherent path, it is obvious that troubles arise and you have to waste time trying to find if there is a combination of OS type, architecture, Python version, package version, dependency version, that may work, digging in the repository release history and requirements.
tflite-model-maker has been released a couple of years ago to simplify model training and it was very good at this, before the project maintenance started to become erratic and lackluster creating a lot of compatibility issues and conflicts.
Is this project development still active?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 16 (1 by maintainers)
I can confirm that installing either the TfLite Model Maker or the MediaPipe one fails using Python v3.11.5 on a Mac M1 for multiple users in our company. @pkgoogle you guys keep saying in multiple GitHub issues that this is actively worked upon, but:
I’m sorry, but at this point, it’s a very valid question if the project development is still active. Do you guys even test out if the tools work? Like, seriously. Get a fresh new laptop and try to install either of the 2 model makers following the official tutorial.
On the subject of
mediapipe-model-makerthis reply points to an announcement from the Tensorflow Text team stating that wheels will be provided only for Linux x86_64 and Intel-based Macs (mediapipe-model-makerdepends ontensorflow-textat present).The recommended solution is to build wheels for the desired platform from source yourself.
Moreover, quoting from the announcement
I fully empathise with @bogdanzurac’s frustration! Arm64-based Macs are not bleeding-edge hardware anymore, and the fact that this issue still persist is IMO pretty embarrassing for the team responsible for these tools.
I’ll try to summarise the approaches I have tried and my findings, in the hope that someone (@pkgoogle perhaps?) might take appropriate actions or provide constructive hints for how to move this forward.
Installing with Python 3.11 on MacOs with Arm64 (native environment) fails on
tflite-supportLatest version of
tflite-supportat time of writing (linked above) provides wheels for Linux/Arm64 and MacOs/x86_64, but not the combo MacOs/Arm64. Python 3.11 is not the issue in this case, ref list of wheels in link above.tflite-supportis built using Bazel, with which I’m not familiar. I might spend some time later to understand Bazel and try to buildtflite-supportfor MacOs/Arm64. Any constructive hints are greatly appreciated (not links to the manual - I’m able to find that myself 😉 )Given that
tflite-supportis provided for MacOs/x86_64, it’s tempting to lean on Rosetta and install x86_64 versions of everything. However, scrolling a little down on the linked page reveals that AVX-instructions are not translated by Rosetta. Furthermore, this issue indicates that QEMU/Docker may not come to the rescue here either. Since Tensorflow seems to rely heavily on AVX the approach of using x86_64 binaries seems to be unfruitful.Last possibility I see on my M1 is to try wheels for Linux/Arm64 with some Arm64-based Linux like e.g. python:3.9-bullseye running in Docker:
(NOTE: The option
--use-deprecated=legacy-resolverto pip is crucial in next step - wish the docs were clearer on this. See e.g. this issue.)Looking up wheels for tensorflow-addons on pypi we see that there is indeed no wheel for Linux/Arm64. Ironically, there are wheels for MacOs/Arm64… 🤦 Moreover, adding insult to injury, tensorflow-addons will be discontinued in a year or so.
sigh
Installing mediapipe-model-maker (aka “new kid on the block”) on MacOs/Arm64 fails because tensorflow-text==2.13.0 has no wheel for the platform
Installing the
mediapipe-model-makerin Linux/Arm64 under Docker bumps into the problem withtensorflow-addonsHence, on an Arm-based Mac trying to use
tflite-model-makerI’m stuck until eithertflite-supportprovides wheel for MacOs/Arm64tensorflow-addonsprovides wheel for Linux/Arm64 (requires QEMU/Docker)and trying to use
mediapipe-model-makerI’m stuck until eithertensorflow-text==2.13.0provides wheel for MacOs/Arm64tensorflow-addonsprovides wheel for Linux/Arm64 (requires QEMU/Docker)yes, images.
Hi @BjarneHerland, it is probably best to post those issues on the mediapipe github issues page: https://github.com/google/mediapipe/issues, I tried a couple of things it seems python=3.10 works best. I was able to install with python=3.10 successfully on linux x86_64. It might be worth it to try on linux ARM. Using colab is probably the most stable currently. I am running into a different issue for my mac M1. :