[英]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.