deeplabv3+训练的ckpt模型Android端部署
接上一篇文章用deeplabV3+训练自己的数据集并导出.pb模型进行可视化测试
一.对deeplabv3+训练的ckpt模型做量化
参考官方文档
修改train.py文件
flags.DEFINE_string('train_logdir', "./datasets/VOC/out",
'Where the checkpoint and logs are stored.')
flags.DEFINE_float('base_learning_rate', 3e-5,
'The base learning rate for model training.')
flags.DEFINE_integer('training_number_of_steps', 5000,
'The number of steps used for training') ########### 迭代次数
flags.DEFINE_string('tf_initial_checkpoint', "/home/dreamdeck/Downloads/Tensorflow/models-master/research/deeplab/datasets/VOC/trainout/model.ckpt",
'The initial checkpoint in tensorflow format.') ##上一步训练好的模型文件
flags.DEFINE_integer(
'quantize_delay_step', 0,
'Steps to start quantized training. If < 0, will not quantize model.')
运行train.py
二.量化后的.ckpt模型转.pb模型
修改export_model.py
flags.DEFINE_string('checkpoint_path', "./datasets/VOC/out/model.ckpt", 'Checkpoint path')
flags.DEFINE_string('export_path', "./datasets/VOC/out/frozen_inference_graph.pb",
'Path to output Tensorflow frozen graph.')
flags.DEFINE_integer('num_classes', 2, 'Number of classes.')
flags.DEFINE_multi_integer('crop_size', [513, 513],
'Crop size [height, width].')
flags.DEFINE_integer(
'quantize_delay_step', 0<

本文详细指导如何使用 DeeplabV3+ 的训练模型进行量化处理,包括修改train.py和export_model.py脚本,然后转换为pb模型,进一步转化为TFLite模型,并在Android端进行部署。步骤涉及模型量化、模型导出和在实际应用中的适配。
最低0.47元/天 解锁文章
6943





