我无法在 Apple Silicon 上安装 Tensorflow Model Maker

Fre*_*red 6 pip tensorflow tensorflow-lite apple-silicon apple-m1

我有 Apple M1 Pro 芯片,但无法运行我的张量流项目。我按照Apple 网站上的安装说明进行操作。

当我运行时pip install -r requirements.txt,我的所有 python 软件包都会安装,除了tflite-model-maker. 我收到以下错误:

ERROR: Cannot install -r requirements.txt (line 19) and tflite-support because these package versions have conflicting dependencies.

The conflict is caused by:
    tflite-model-maker 0.3.4 depends on tensorflow>=2.6.0
    tflite-model-maker 0.3.3 depends on tensorflow>=2.6.0
    tflite-model-maker 0.3.2 depends on tensorflow>=2.4.0
    tflite-model-maker 0.3.1 depends on tensorflow>=2.4.0
    tflite-model-maker 0.3.0 depends on tensorflow>=2.4.0
    tflite-model-maker 0.2.5 depends on tensorflow>=2.4.0
    The user requested tflite-support
    tflite-model-maker 0.2.4 depends on tflite-support==0.1.0rc4
    tflite-model-maker 0.2.3 depends on tf-nightly==2.4.0.dev20200902
    tflite-model-maker 0.2.2 depends on tf-nightly==2.4.0.dev20200902
    tflite-model-maker 0.2.1 depends on tf-nightly==2.4.0.dev20200811
    tflite-model-maker 0.2.0 depends on tf-nightly==2.4.0.dev20200810
    tflite-model-maker 0.1.2 depends on tf-nightly
    The user requested tflite-support
    tflite-model-maker 0.1.1 depends on tflite-support==0.1.0a0
    The user requested tflite-support
    tflite-model-maker 0.1.0 depends on tflite-support==0.1.0a0

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
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

小智 -1

我也遇到了同样的问题,tflite_model_maker的官方版本还不支持M1芯片。

但您可以在不安装库的情况下转换模型:

1-安装 TensorFlow:我使用了本教程:完美运行:https ://sudhanva.me/install-tensorflow-on-apple-m1-pro-max/

2-使用 Keras os 创建模型并加载它:

import tensorflow
model = tensorflow.keras.models.load_model(load_weights)
Run Code Online (Sandbox Code Playgroud)

3- 将您的模型转换为 tflite:

converter = tensorflow.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()

with open('new_model.tflite', 'wb') as f:
    f.write(tflite_model)
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

1926 次

最近记录:

3 年,6 月 前