1、在yolov7中把yolov7.pt轉(zhuǎn)為.onnx
python3 export.py --weights weights/yolov7.pt --grid --simplify --topk-all 100 --img-size 640 640 --max-wh 640
atc --model=yolov7.onnx --framework=5 --output=yolov7 --input_shape="images:1,3,640,640" --soc_version=Ascend310 --insert_op_conf=aipp.cfg2、在CANN環(huán)境下使用act把.onnx轉(zhuǎn)為.om
3、在C++程序中使用CANN對(duì)yolov7.om模型推理,執(zhí)行aclmdlExecute()函數(shù)失敗。
返回錯(cuò)誤碼:507011
解決辦法:
在阿特拉斯設(shè)備中查看設(shè)備信息:
npu-smi info
可以看到芯片型號(hào)是310B1
修改act命令參數(shù):
atc --model=yolov7.onnx --framework=5 --output=yolov7 --input_shape="images:1,3,640,640" --soc_version=Ascend310B1 --insert_op_conf=aipp.cfg
把生成的.om文件放到C++程序中進(jìn)行推理,推理成功?。?!
O了!
我翹里哇?。。。。。。。。。。。。。。。。。。。。。。。。。?br />