atc 工具,把 onnx 模型转成 om 模型,但是遇到报错找不到 ai_core?

我在华为云,开了一个 Ascend310 的实例

图片.png

然后我是用 atc 工具,把 onnx 模型转成 om 模型,但是遇到报错

root@ascend310:~/code/image2vector# atc --framework=5 --model=2_sim.onnx --output=2_sim_ascend310 --input_format=NCHW --log=debug --soc_version=Ascend310
ATC start working now, please wait for a moment.
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E19000: Path[/usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/ai_core/tbe/config/ascend310]'s realpath is empty, errmsg[The file path does not exist.]

从报错看,是 atc 需要一个 /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/ai_core/tbe/config/ascend310 下面文件,但是我的目录 /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/ 下面是空的

root@ascend310:~/code/image2vector# ll /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/
total 8
drwxr-xr-x 2 HwHiAiUser HwHiAiUser 4096 Nov  6  2020 ./
dr-xr-xr-x 4 HwHiAiUser HwHiAiUser 4096 Nov  6  2020 ../

怎么办?


我看到 /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/built-in/ai_core/tbe/config 路径下是有的

图片.png


然后我复制

cp -r /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/built-in/ai_core /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/

在查看

root@ascend310:~/code/image2vector# ll /usr/local/Ascend/ascend-toolkit/20.1.rc1/x86_64-linux/opp/op_impl/custom/
total 12
drwxr-xr-x 3 HwHiAiUser HwHiAiUser 4096 Aug 10 14:32 ./
dr-xr-xr-x 4 HwHiAiUser HwHiAiUser 4096 Nov  6  2020 ../
dr-xr-xr-x 4 root       root       4096 Aug 10 14:32 ai_core/

然后重新转换模型

root@ascend310:~/code/image2vector# atc --framework=5 --model=2_sim.onnx --output=2_sim_ascend310 --input_format=NCHW --log=debug --soc_version=Ascend310
ATC start working now, please wait for a moment.



ATC run failed, Please check the detail log, Try 'atc --help' for more information
E19999: Unknown error occurred. Please check the log.

直接变成未知错误了

阅读 3.9k
1 个回答

这个问题解决了,具体可看:https://gitee.com/ascend/modelzoo/issues/I7S5KS

大概就是算子不支持,需要自己一个一个去排除不支持的算子


我讲一下我的情况

我们要适配 atlas300I pro(为了甲方所谓的自主可控)

但是甲方那边事多,不给联网

然后我就自己找办法,去华为云开了一个 Ascend310

选择的是 ubuntu18.04

很坑的地方在于,华为云这 gr 的,上面的驱动和 acnn 版本都很古老,都是 3 年前的

不是我故意买旧的,是只有这个可以选

很多问题都是来自 acnn 太古老导致的

所以我建议你,如果你也是不幸在华为云买的 Ascend310,先自己升级 acnn 版本到最新

我是升级到了 6.3
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题