cd /workspace/examples/SSD_object/model
bmrt_test --context_dir=./out/ssd300
正常结束后提示如下:
[BMRT][deal_with_options:1378] INFO:Loop num: 1
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:823] INFO:Loading bmodel from [./out/ssd300/compilation.bmodel]. Thanks for your patience...
[BMRT][load_bmodel:787] INFO:pre net num: 0, load net num: 1
[BMRT][bmrt_test:705] INFO:==> running network #0, name: VGG_VOC0712_SSD_300x300_deploy, loop: 0
[BMRT][bmrt_test:981] INFO:net[VGG_VOC0712_SSD_300x300_deploy] stage[0], launch total time is 34126 us (npu 33602 us, cpu 524 us)
[BMRT][bmrt_test:984] INFO:+++ The network[VGG_VOC0712_SSD_300x300_deploy] stage[0] output_data +++
[BMRT][print_array:647] INFO:output data #0 shape: [1 1 1 7 ] < 0 -1 -1 -1 -1 -1 -1 >
[BMRT][bmrt_test:1004] INFO:==>comparing #0 output ...
[BMRT][bmrt_test:1009] INFO:+++ The network[VGG_VOC0712_SSD_300x300_deploy] stage[0] cmp success +++
[BMRT][bmrt_test:1029] INFO:load input time(s): 0.001130
[BMRT][bmrt_test:1030] INFO:calculate time(s): 0.034130
[BMRT][bmrt_test:1031] INFO:get output time(s): 0.000060
[BMRT][bmrt_test:1032] INFO:compare time(s): 0.000160
当有“+++ The network[VGG_VOC0712_SSD_300x300_deploy] stage[0] cmp success +++”的提示,则模型编译流程正确,与原生模型的精度一致。
python形式:
import bmnetc## compile fp32 modelbmnetc.compile( model ="/path/to/prototxt", ## Necessary weight ="/path/to/caffemodel", ## Necessary outdir ="xxx", ## Necessary target ="BM1684", ## Necessary shapes = [[x,x,x,x], [x,x,x]], ## optional, if not set, default use shape in prototxt net_name ="name", ## optional, if not set, default use the network name in prototxt opt =2, ## optional, if not set, default equal to 2 dyn =False, ## optional, if not set, default equal to False cmp =True, ## optional, if not set, default equal to True enable_profile =False## optional, if not set, default equal to False)
bmnetc若成功,输出的 log 最后会看到以下信息:
####################################### Store bmodel of BMCompiler.######################################