登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
人工智能
>
AI-人工智能
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
215
Star
1.2K
Fork
1K
Ascend
/
samples
代码
Issues
53
Pull Requests
91
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Exception: acl.mdl.load_from_file failed ret_int=145001
DONE
#I7SMY4
Bug-Report
ponponon
创建于
2023-08-12 11:20
一、问题现象(附报错日志上下文): ```python import os import numpy as np from label import labels import cv2 from acllite_imageproc import AclLiteImage from acllite_imageproc import AclLiteImageProc from acllite_model import AclLiteModel from acllite_resource import AclLiteResource from acllite_logger import log_info model = AclLiteModel('/root/code/resnet50-b100_ascend310.om') acllite_image=AclLiteImage(['data/dog.jpg']*100) model.execute(acllite_image) ``` 运行上面的代码报错: ```shell (samples) root@ascend310:~/code/ascend_example# python main2.py [INFO] Init model resource start... Traceback (most recent call last): File "main2.py", line 14, in <module> model = AclLiteModel('/root/code/resnet50-b100_ascend310.om') File "/root/code/ascend_example/acllite_model.py", line 44, in __init__ self._init_resource() File "/root/code/ascend_example/acllite_model.py", line 58, in _init_resource utils.check_ret("acl.mdl.load_from_file", ret) File "/root/code/ascend_example/acllite_utils.py", line 18, in check_ret .format(message, ret_int)) Exception: acl.mdl.load_from_file failed ret_int=145001 Exception ignored in: <function AclLiteModel.__del__ at 0x7f27631c2170> Traceback (most recent call last): File "/root/code/ascend_example/acllite_model.py", line 446, in __del__ self.destroy() File "/root/code/ascend_example/acllite_model.py", line 427, in destroy if self._is_destroyed: AttributeError: 'AclLiteModel' object has no attribute '_is_destroyed' ``` 关于上面的 om 模型的来源 我先用 pytorch 导出了一个 resnet50 网络 ```python from torch import Tensor import torch.nn.functional as F import torch import torchvision model = torchvision.models.resnet50(pretrained=True) dummy_input = torch.randn(100, 3, 224, 224) torch.onnx.export( model, dummy_input, "resnet50-b100.onnx", input_names=["input"], output_names=["output"], opset_version=11, ) ``` 保存为 resnet50-b100.onnx 然后使用 atc 工具将 resnet50-b100.onnx 转成 om 模型 ```shell atc --framework=5 --model=resnet50-b100.onnx --output=resnet50-b100_ascend310 --input_format=NCHW --log=debug --soc_version=Ascend310 ``` 得到 resnet50-b100_ascend310.om 之后,我就运行了上面的 python 代码,得到了对应的报错 我的 python 代码是参考了:https://gitee.com/ascend/samples/blob/master/inference/modelInference/sampleYOLOV7NMSONNX/src/sampleYOLOV7NMSONNX.py > 运行 sampleYOLOV7NMSONNX.py 是可以成功的,可以生成那个 dog 图 >  我不清楚是我的 om 模型有问题,还是这个 AclLiteModel 不能运行 resnet50 ? 二、软件版本: -- CANN 版本 (e.g., CANN 3.0.x,5.x.x): 社区版 Ascend-cann-toolkit_6.3.RC2 --Tensorflow/Pytorch/MindSpore 版本: 未使用 --Python 版本 (e.g., Python 3.7.5): 3.7.5 -- MindStudio版本 (e.g., MindStudio 2.0.0 (beta3)): 未使用 --操作系统版本 (e.g., Ubuntu 18.04): Ubuntu 18.04
一、问题现象(附报错日志上下文): ```python import os import numpy as np from label import labels import cv2 from acllite_imageproc import AclLiteImage from acllite_imageproc import AclLiteImageProc from acllite_model import AclLiteModel from acllite_resource import AclLiteResource from acllite_logger import log_info model = AclLiteModel('/root/code/resnet50-b100_ascend310.om') acllite_image=AclLiteImage(['data/dog.jpg']*100) model.execute(acllite_image) ``` 运行上面的代码报错: ```shell (samples) root@ascend310:~/code/ascend_example# python main2.py [INFO] Init model resource start... Traceback (most recent call last): File "main2.py", line 14, in <module> model = AclLiteModel('/root/code/resnet50-b100_ascend310.om') File "/root/code/ascend_example/acllite_model.py", line 44, in __init__ self._init_resource() File "/root/code/ascend_example/acllite_model.py", line 58, in _init_resource utils.check_ret("acl.mdl.load_from_file", ret) File "/root/code/ascend_example/acllite_utils.py", line 18, in check_ret .format(message, ret_int)) Exception: acl.mdl.load_from_file failed ret_int=145001 Exception ignored in: <function AclLiteModel.__del__ at 0x7f27631c2170> Traceback (most recent call last): File "/root/code/ascend_example/acllite_model.py", line 446, in __del__ self.destroy() File "/root/code/ascend_example/acllite_model.py", line 427, in destroy if self._is_destroyed: AttributeError: 'AclLiteModel' object has no attribute '_is_destroyed' ``` 关于上面的 om 模型的来源 我先用 pytorch 导出了一个 resnet50 网络 ```python from torch import Tensor import torch.nn.functional as F import torch import torchvision model = torchvision.models.resnet50(pretrained=True) dummy_input = torch.randn(100, 3, 224, 224) torch.onnx.export( model, dummy_input, "resnet50-b100.onnx", input_names=["input"], output_names=["output"], opset_version=11, ) ``` 保存为 resnet50-b100.onnx 然后使用 atc 工具将 resnet50-b100.onnx 转成 om 模型 ```shell atc --framework=5 --model=resnet50-b100.onnx --output=resnet50-b100_ascend310 --input_format=NCHW --log=debug --soc_version=Ascend310 ``` 得到 resnet50-b100_ascend310.om 之后,我就运行了上面的 python 代码,得到了对应的报错 我的 python 代码是参考了:https://gitee.com/ascend/samples/blob/master/inference/modelInference/sampleYOLOV7NMSONNX/src/sampleYOLOV7NMSONNX.py > 运行 sampleYOLOV7NMSONNX.py 是可以成功的,可以生成那个 dog 图 >  我不清楚是我的 om 模型有问题,还是这个 AclLiteModel 不能运行 resnet50 ? 二、软件版本: -- CANN 版本 (e.g., CANN 3.0.x,5.x.x): 社区版 Ascend-cann-toolkit_6.3.RC2 --Tensorflow/Pytorch/MindSpore 版本: 未使用 --Python 版本 (e.g., Python 3.7.5): 3.7.5 -- MindStudio版本 (e.g., MindStudio 2.0.0 (beta3)): 未使用 --操作系统版本 (e.g., Ubuntu 18.04): Ubuntu 18.04
评论 (
8
)
登录
后才可以发表评论
状态
DONE
TODO
Analysing
ACCEPTED
WIP
Feedback
TEST
DONE
REJECTED
负责人
未设置
wuyan
MXYG
负责人
协作者
+负责人
+协作者
张安琪
zhang-anqi11
负责人
协作者
+负责人
+协作者
标签
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (16)
标签 (27)
master
r1.7
r1.5
r1.6
pr_2663
add_lut4_llama7b_quantization
r1.4
r1.3
r1.1
r1.2
r1.21.0
r0.2
r1.0
r0.3
8.0.RC3_bugfix
r.ss928.1
v1.7-8.3.RC1.alpha001
v1.5-8.2.RC1
v1.6-8.2.RC1.alpha003
v1.4-8.2.RC1.alpha002
v1.3-8.2.RC1.alpha001
v1.1-8.1.RC1.beta1
v1.2-8.1.RC1.alpha002
v1.0-8.1.RC1.alpha001
v0.2-8.0.0.beta1
v0.3-8.0.0.alpha003
8.0.RC3
v0.1-8.0.0.alpha002
8.0.RC2.2
8.0.RC2
8.0.RC1
7.0.0
7.0.RC1
6.3.RC2
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.1.0
v0.2.0
v0.3.0
v0.4.0
v0.5.0
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(2)
1
https://gitee.com/ascend/samples.git
git@gitee.com:ascend/samples.git
ascend
samples
samples
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册