paddle模型转nb端侧部署模型
This commit is contained in:
16
tool/paddle2nb.py
Normal file
16
tool/paddle2nb.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from paddlelite.lite import Opt
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 1. 创建opt实例
|
||||
opt = Opt()
|
||||
# 2. 指定输入模型地址
|
||||
opt.set_model_dir("./model")
|
||||
# 3. 指定转化类型: arm、x86、opencl、npu
|
||||
# 一般认为arm为cpu,opencl为gpu
|
||||
opt.set_valid_places("arm")
|
||||
# 4. 指定模型转化类型: naive_buffer、protobuf
|
||||
opt.set_model_type("naive_buffer")
|
||||
# 4. 输出模型地址
|
||||
opt.set_optimize_out("model")
|
||||
# 5. 执行模型优化
|
||||
opt.run()
|
||||
Reference in New Issue
Block a user