如何减小我从keras转换的.tflite的大小

2024-04-20 14:08:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚把在google上创建的Keras model .h5(resnet50 img classify)转换成.tflite,但是大小就像0.5 MB一样减小了。你知道吗

这是一个移动应用程序和大小应该减少更多。它就像90MB,对于生产来说太大了。你知道吗

操作系统平台和发行版=Linux-4.14.79+-x86\u 64-with-Ubuntu-18.04-bionic

TensorFlow版本='1.14.0-rc1'

CUDA/cuDNN版本=V10.0.130

GPU型号和内存=11441MB |特斯拉K80

from tensorflow import lite
converter = lite.TFLiteConverter.from_keras_model_file( '/gdrive/My Drive/Places/model.h5')
tfmodel = converter.convert()
open ("model.tflite" , "wb") .write(tfmodel)

我希望firebase支持的大小会减少到40MB?我哪里做错了或者我该怎么办?我甚至用了pytorch,把till.pb从.pth转换过来,但是做不到

How to convert from .pb to .tflite?


Tags: tofrom版本convertimgmodelgooglelite