简体   繁体   English

如何使用 Python API 从 Google AutoML Vision 导出 tflite 模型?

[英]How to export a tflite model from Google AutoML Vision using Python API?

I try to export a tflite model from a Google AutoML Vision trained model.我尝试从 Google AutoML Vision 训练模型导出 tflite 模型。 I use the Python API to manage the data and train the model.我使用 Python API 来管理数据和训练模型。 Unfortunately, I receive an error telling me "400 Unsupported model export format [tflite] for model ".不幸的是,我收到一条错误消息,告诉我“400 Unsupported model export format [tflite] for model”。 This happens even though I set the model metadata to即使我将模型元数据设置为

model_metadata = automl.ImageClassificationModelMetadata(
   train_budget_milli_node_hours = i
   model_type = "mobile-versatile-1"

and also set the export output_config to并将导出 output_config 设置为

output_config = automl.ModelExportOutputConfig(
   gcs_destination=...,
   model_format="tflite"
)

When entering the Google Cloud Console manually, I strangely also encounter the problem that it also only shows me the options "REST API" and "Python" in the "Test & Use" tab.手动进入 Google Cloud Console 时,奇怪的是我也遇到了问题,它也只显示“测试和使用”选项卡中的“REST API”和“Python”选项。

Hence the question: Why are my options so limited manually (did Google remove export functions)?因此,问题是:为什么我的手动选项如此有限(Google 是否删除了导出功能)? And how can I set my Python API code to allow for tflite export?以及如何设置我的 Python API 代码以允许 tflite 导出? Thanks!谢谢!

The options to export a model as TFLite / TFlite.js / Container are only available, if you train your model using the "Edge" option:将模型导出为 TFLite / TFlite.js / Container 的选项仅在您使用“Edge”选项训练模型时可用:

训练新模型

If you select "Cloud hosted", which is the default, only "REST API" and "Python" are available after training.如果您选择“云托管”(默认设置),则训练后只有“REST API”和“Python”可用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Google AutoML Vision Python API 来更新数据集 - How to use Google AutoML Vision Python API to update_dataset 如何使用来自 Google AutoML Vision Classification 的 TensorFlow Frozen GraphDef (single saved_model.pb) 进行推理和迁移学习 - How to do Inference and Transfer Learning with TensorFlow Frozen GraphDef (single saved_model.pb) from Google AutoML Vision Classification 如何显示多个预测AutoML Vision API - How to display multiple predictions AutoML Vision API 尽管已分配了正确的服务帐户,但使用Google AutoML vision Python API仍获得403响应 - getting a 403 response with Google AutoML vision Python API despite having assigned right Service Account 如何通过 Python 使用 Google Vision OCR API 获取字数? - How to get Word Count using Google Vision OCR API by Python? 如何使用 python 使用本地图像查询 Google Cloud Vision API? - How to Query the Google Cloud Vision API with a local image using python? 如何使用 Google 的视觉 API 从单个调用中注释多个图像? Python - How to annotate MULTIPLE images from a single call using Google's vision API? Python AutoML Vision Edge 中的 saved_model 未正确加载 - saved_model from AutoML Vision Edge not loading properly Tflite model 在 Android(ml 视觉)和 ZA7F5F35426B5674113ZB3821 中给出不同的 output - Tflite model giving different output in Android (ml vision) and Python 如何在python程序中使用Google Vision API? - How to use Google Vision API in python program?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM