准备paddleLite和opt工具,在notebook中使用opt工具得到nb文件
!pip install paddlelite==2.9
!paddle_lite_opt --model_file=output_model.pdmodel --param_file=output_model.pdiparams --optimize_out=face
Looking in indexes: https://mirror.baidu.com/pypi/simple/
Requirement already satisfied: paddlelite==2.9 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (2.9)
Loading topology data from output_model.pdmodel
Loading params data from output_model.pdiparams
1.Model is successfully loaded!
2.Model is optimized and saved into face.nb successfully
总结:
opt将模型转化为nb文件,但用的不是output.pdopt和output.pdparams而是output_model.pdmodel和output_model.pdiparams