切换到vdec_resnet50_classification样例目录,命令示例如下,从output参数设置的目录下获取om文件:
atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50_aipp --soc_version=${soc_version} --insert_op_conf=caffe_model/aipp.cfg
可从ATC安装路径的“atc/data/platform_config”目录下查看昇腾AI处理器的版本,对应“*.ini”文件的名字(不带.ini后缀)即为soc_version。
const char* omModelPath = "../model/resnet50_aipp.om";
从以下链接获取输入视频码流文件,并以运行用户上传至开发环境的“vdec_resnet50_classification样例目录/data”目录下。如果目录不存在,需自行创建。
https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/models/aclsample/vdec_h265_1frame_rabbit_1280x720.h265
“../../../src”表示CMakeLists.txt文件所在的目录,请根据实际目录层级修改。
cd 样例目录\build\intermediates\soc cmake ../../../src -DCMAKE_SKIP_RPATH=TRUE -G "Visual Studio 15 2017 Win64" cmake --build .
cd 样例目录\build\intermediates\soc cmake ../../../src -DCMAKE_SKIP_RPATH=TRUE -G "Visual Studio 15 2017 Win64" -DCMAKE_CONFIGURATION_TYPES=release cmake --build . --config release
当前样例的编码字符集为ASCII,编译命令默认都是ASCII编码字符集,不支持Unicode编码字符集,如需支持Unicode编码字符集,需用户自行适配代码。
main.exe
可执行文件执行成功后,在屏幕上的关键提示信息示例如下:
...... [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_0, size=4000 [INFO] start check result file:./result/model_output_0 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_0.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_1, size=4000 [INFO] start check result file:./result/model_output_1 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_1.txt] [INFO] result:classType[688],top1[0.596680],top5[0.901611] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_2, size=4000 [INFO] start check result file:./result/model_output_2 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_2.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_3, size=4000 [INFO] start check result file:./result/model_output_3 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_3.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_4, size=4000 [INFO] start check result file:./result/model_output_4 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_4.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_5, size=4000 [INFO] start check result file:./result/model_output_5 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_5.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_6, size=4000 [INFO] start check result file:./result/model_output_6 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_6.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_7, size=4000 [INFO] start check result file:./result/model_output_7 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_7.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_8, size=4000 [INFO] start check result file:./result/model_output_8 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_8.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] Process dvpp success [INFO] model execute success [INFO] output[0] DataBuffer, buffer addr = 0x10100007c000, buffer size = 4000 [INFO] memcopy output data from device to host buffer success. [INFO] create output file success, filename=./result/model_output_9, size=4000 [INFO] start check result file:./result/model_output_9 [INFO] check result success, file exist [INFO] reselut file: [./result/model_output_9.txt] [INFO] result:classType[331],top1[0.908203],top5[1.000015] [INFO] unload model success, modelId is 1 [INFO] execute sample success ......