Is this possible? I want the brevity/ease of use of tflite-model-maker with the acceleration capabilities of my M1 MacBook Air running macOS 12.0.
I successfully completed the step to install tensorflow-macos, which to my understanding is just a special version of tensorflow 2.5 to take advantage of the M1 hardware acceleration.
Now, when I try to follow the tflite-model-maker example this happens:
I expected an error because in the requirements.txt, tensorflow==2.6.0 is specified (not tensorflow-macos==2.5.0).
Could I just edit that requirements file to specify tensorflow-macos=2.5.0 instead of tensorflow==2.6.0? Or is there an older version of tflite-model-maker that will work with tensorflow-macos==2.5.0?
I assume this is what is also causing the tflite-support dependency problem.
Iβve installed Tensorflow as per the Apple docs:
and then tried to install tflite-model-maker and get the same issue as the OP. If I edit requirements.txt to change the dependency to tensorflow-macos instead of tensorflow, I get an error with tflite-support.
Is there a working guide on how to install tflite-model-maker on a M1 Macbook? Iβm not too bothered about using the M1 neural capabilities just yet.
If I try and install the packages as per the tflite-model-maker docs and a simple Python script that converts a model, Python crashes and it seems to be related to Rosetta trying to run a x86 version of Tensorflow on M1
OS Platform and Distribution: macOS 13.3.1 (MacBook Pro M2)
Python Version: Python 3.9.16
My log:
haesunglee@MacBookPro14-haesunglee ~ % sudo pip3 install tflite-model-maker
Password:
WARNING: The directory '/Users/haesunglee/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting tflite-model-maker
Downloading tflite_model_maker-0.4.2-py3-none-any.whl (577 kB)
ββββββββββββββββββββββββββββββββββββββββ 577.3/577.3 kB 12.7 MB/s eta 0:00:00
Collecting tf-models-official==2.3.0 (from tflite-model-maker)
Downloading tf_models_official-2.3.0-py2.py3-none-any.whl (840 kB)
ββββββββββββββββββββββββββββββββββββββββ 840.9/840.9 kB 11.7 MB/s eta 0:00:00
...
...
...
Collecting tflite-model-maker
Downloading tflite_model_maker-0.1.0-py3-none-any.whl (84 kB)
ββββββββββββββββββββββββββββββββββββββββ 84.6/84.6 kB 12.7 MB/s eta 0:00:00
ERROR: Cannot install tflite-model-maker==0.1.2, tflite-model-maker==0.2.0, tflite-model-maker==0.2.1, tflite-model-maker==0.2.2, tflite-model-maker==0.2.3, tflite-model-maker==0.2.4, tflite-model-maker==0.2.5, tflite-model-maker==0.3.0, tflite-model-maker==0.3.1, tflite-model-maker==0.3.2, tflite-model-maker==0.3.3, tflite-model-maker==0.3.4, tflite-model-maker==0.4.0, tflite-model-maker==0.4.1 and tflite-model-maker==0.4.2 because these package versions have conflicting dependencies.
The conflict is caused by:
tflite-model-maker 0.4.2 depends on tflite-support>=0.4.2
tflite-model-maker 0.4.1 depends on tflite-support-nightly
tflite-model-maker 0.4.0 depends on tflite-support>=0.4.0
tflite-model-maker 0.3.4 depends on tflite-support>=0.3.1
tflite-model-maker 0.3.3 depends on tflite-support>=0.3.1
tflite-model-maker 0.3.2 depends on tflite-support>=0.1.0rc4
tflite-model-maker 0.3.1 depends on tflite-support>=0.1.0rc4
tflite-model-maker 0.3.0 depends on tflite-support>=0.1.0rc4
tflite-model-maker 0.2.5 depends on tflite-support==0.1.0rc4
tflite-model-maker 0.2.4 depends on tflite-support==0.1.0rc4
tflite-model-maker 0.2.3 depends on tflite-support==0.1.0rc3.dev2
tflite-model-maker 0.2.2 depends on tflite-support==0.1.0rc3.dev2
tflite-model-maker 0.2.1 depends on tflite-support==0.1.0rc3.dev2
tflite-model-maker 0.2.0 depends on tflite-support==0.1.0rc3.dev2
tflite-model-maker 0.1.2 depends on tflite-support==0.1.0rc3.dev2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
haesunglee@MacBookPro14-haesunglee ~ %