栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Tensorflow Lite 笔记(二)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Tensorflow Lite 笔记(二)

tensorflow lite model maker
metadata which provides a standard for model descriptions
The default model is EfficientNet-Lite0.
Currently, we support several models such as EfficientNet-Lite* models, MobileNetV2, ResNet50 as pre-trained models for image classification

此处的模型为 EfficientNet-Lite0
model.tflite 大小为 4.0MB
model_fp16.tflite 大小为 6.8MB

此处的模型为 MobileNetV2
model.tflite 大小为 2.8MB
model_fp16.tflite 大小为 4.6MB

此处的模型为 InceptionV3
model.tflite 大小为 22.4MB
model_fp16.tflite 大小为 43.8MB

Post-training quantization is a conversion technique that can reduce model size and inference latency, while also improving CPU and hardware accelerator inference speed, with a little degradation in model accuracy. Thus, it’s widely used to optimize the model

Image classification with TensorFlow Lite Model Maker 总结:
export formats 的几种形式

The allowed export formats can be one or a list of the following:

  • ExportFormat.TFLITE
  • ExportFormat.LABEL
  • ExportFormat.SAVED_MODEL
    By default, it just exports TensorFlow Lite model with metadata. You can also selectively export different files. For instance, exporting only the label file as follows:
model.export(export_dir='.', export_format=ExportFormat.LABEL)

Customize Post-training quantization on the TensorFLow Lite model

config = QuantizationConfig.for_float16()
model.export(export_dir='.', tflite_filename='model_fp16.tflite', quantization_config=config)

Change to the model that’s supported in this library

model = image_classifier.create(train_data, model_spec=model_spec.get('mobilenet_v2'), validation_data=validation_data)

Change to the model in TensorFlow Hub

inception_v3_spec = image_classifier.ModelSpec(
    uri='https://tfhub.dev/google/imagenet/inception_v3/feature_vector/1')
inception_v3_spec.input_image_shape = [299, 299]

Change your own custom model

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/293746.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号