Paddle-Lite opt 转化成nb模型报错

8i9zcol2  于 2022-04-21  发布在  Java
关注(0)|答案(3)|浏览(524)

代码test.py


# 引用Paddlelite预测库

from paddlelite.lite import *

# 1. 创建opt示例

opt=Opt()

# 2. 指定输入模型地址

opt.set_model_file("./ch_det_mv3_db/model")
opt.set_param_file("./ch_det_mv3_db/params")

# 3. 指定转化类型: arm、x86、opencl、xpu、npu

opt.set_valid_places("arm")

# 4. 指定模型转化类型: naive_buffer、protobuf

opt.set_model_type("naive_buffer")

# 4. 输出模型地址

opt.set_optimize_out("ch_det_mv3_db_opt")

# 5. 执行模型优化

opt.run()
~

python3 test.py
result:

[I  8/13 17:50:29.314 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1065 Setup] ARM multiprocessors number: 4
[I  8/13 17:50:29.314 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 0, max freq: 1428, min freq: 1428, cluster ID: 0, CPU ARCH: A57
[I  8/13 17:50:29.314 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 1, max freq: 1428, min freq: 1428, cluster ID: 0, CPU ARCH: A57
[I  8/13 17:50:29.314 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 2, max freq: 1428, min freq: 1428, cluster ID: 0, CPU ARCH: A57
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1067 Setup] ARM multiprocessors ID: 3, max freq: 1428, min freq: 1428, cluster ID: 0, CPU ARCH: A57
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1073 Setup] L1 DataCache size is: 
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1075 Setup] 48 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1075 Setup] 48 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1075 Setup] 48 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1075 Setup] 48 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1077 Setup] L2 Cache size is: 
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1079 Setup] 2048 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1079 Setup] 2048 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1079 Setup] 2048 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1079 Setup] 2048 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1081 Setup] L3 Cache size is: 
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1083 Setup] 0 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1083 Setup] 0 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1083 Setup] 0 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1083 Setup] 0 KB
[I  8/13 17:50:29.315 ...ddle-Lite-2.6.1/lite/core/device_info.cc:1085 Setup] Total memory: 4051520KB
[I  8/13 17:50:29.359 ...tu/Paddle-Lite-2.6.1/lite/api/cxx_api.cc:251 Build] Load model from file.
[F  8/13 17:50:29.431 ...u/Paddle-Lite-2.6.1/lite/core/program.cc:192 Build] Check failed: op: no Op found for hard_swish
mznpcxlj

mznpcxlj1#

你好,错误信息提示缺少算子 hard_swish,但是这个算子我查看了是存在的

xzlaal3s

xzlaal3s2#

在Paddle-Lite v2.6.0之后版本是存在该算子的,请问可以提供一下复现方法吗

dfuffjeb

dfuffjeb3#

@DannyIsFunny@zhangyaobo 您好,请问怎么解决的这个错误呢?求指导一下~

相关问题