切换到resnet50_imagenet_classification样例目录,命令示例如下,从output参数设置的目录下获取om文件:
atc --model=caffe_model/resnet50.prototxt --weight=caffe_model/resnet50.caffemodel --framework=0 --output=model/resnet50 --soc_version=${soc_version} --input_format=NCHW --input_fp16_nodes=data -output_type=FP32 --out_nodes=prob:0
可从ATC安装路径的“atc/data/platform_config”目录下查看昇腾AI处理器的版本,对应“*.ini”文件的名字(不带.ini后缀)即为soc_version。
const char* omModelPath = "../model/resnet50.om";
https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/models/aclsample/dog1_1024_683.jpg
https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/models/aclsample/dog2_1024_683.jpg
python3.7.5 ../script/transferPic.py
如果执行脚本报错“ModuleNotFoundError: No module named 'PIL'”,则表示缺少Pillow库,请使用pip3.7.5 install Pillow --user命令安装Pillow库。
“../../../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
执行成功后,在屏幕上的关键提示信息示例如下: