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

发布于 2025-01-10 11:14:52 字数 1646 浏览 3 评论 0原文

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

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

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

有什么想法吗?

I have the Apple M1 Pro chip and cannot get my tensorflow project running. I followed the installation instructions from Apple's site.

When I run pip install -r requirements.txt, all my python packages install except for tflite-model-maker. I get the following error:

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

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿嘿嘿 2025-01-17 11:14:52

我也遇到了同样的问题,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)

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)

I had the same problem, the official release of tflite_model_maker doesn't support M1 chip yet.

But you can convert your model without installing the library:

1- Install TensorFlow: I used this tutorial: works perfectly: https://sudhanva.me/install-tensorflow-on-apple-m1-pro-max/

2- create your model using Keras os load it:

import tensorflow
model = tensorflow.keras.models.load_model(load_weights)

3- Convert your model to 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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文