fallback - 以黑色为主的 uint16 图像的训练后量化
问题描述
我的应用程序有一个训练有素的模型,我尝试使用 keras 进行训练后量化。但是后备量化根本不起作用。我的图像是 uint16,它是灰度(1 通道)。我的模型无需量化即可工作。在我的其他应用程序中,量化也适用于 rgb 图像。但是使用后备量化,我的模型和 uint16 灰度数据没有得到很好的输出。这是我使用的图像的分布。
训练后量化应该怎么做?
这是转换的代码:
{input_data = (img/(255*255)).astype('float32')
interpreter = tf.lite.Interpreter(model_path=TFLiteModelPath)
interpreter.allocate_tensors()
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
interpreter.set_tensor(input_details[0]['index'], input_data)
interpreter.invoke()
TFLiteResult = interpreter.get_tensor(output_details[0]['index'])
img =TFLiteResult[0]*255*255}
解决方案
推荐阅读
- android - 检测wifi列表Flutter
- swift - 没有这样的模块“AWSAppSync”
- forms - 如何在opencart 3.0.2的注册页面上合并名字和姓氏字段?
- python-3.7 - 使用正则表达式模式从文本文件中提取 url
- xamarin.forms - 加载列表项后如何从配置文件保存的模型中设置值
- python-2.7 - 使用python将数据插入SQLite3数据库时如何避免插入重复数据?
- javascript - Javascript 中是否有 Function.caller 的生产安全版本?
- javascript - 在 ESRI 地图中禁用双击放大
- jquery - 表 TD 使用 jquery.ui re-sizable 事件以百分比调整大小
- java - 在 Spring AOP 中,joinPoint.proceed 和 method.invoke 有什么区别?