yolov5权重转换
收藏回复举报
yolov5权重转换
新人帖
发表于2024-04-03 14:15:09
0 查看

我现在有一块atlas200的板子,在pc上把pt权重转换成onxx,再在板子上通过ATC转换成om文件

目前出现以下问题:

1、onxx的文件在pc端是可以跑通的,但是无法通过以下任意一个命令转换成功,这两个命令来自官方文档https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/tmuacop/tmuacop_0025.html

atc --model=yolov5s.onnx --framework=5 --output=yolov5s_bs1 --input_format=NCHW --soc_version=Ascend310B4 --input_fp16_nodes="images"
atc --model=model.onnx --framework=5 --output=model --soc_version=Ascend310B4

2、我从知乎上找到了一个命令,这个是完全可以跑通的。

atc --model=yolov5m.onnx --framework=5 --input_shape="images:1,3,640,640" --output=./model/yolov5m --soc_version=Ascend310

但是我使用官方样例的时候调用自己转换的om文件,依旧无法运行成功,报错:

RuntimeError	Traceback (most recent call last)	
/tmp/ipykernel_6244/1523349011.pyin<cell hane: 10>()
8 label_path./coco names.txt9#初始化推理模型
> 10 model- InferSession(0, model_path)
11 labels dict - get labels from txt(label _path)
/usr/local/miniconda3/1ib/python3.9/site-packages/ais_bench/infer/interface.py in anit (self, device id, model_path, acl json_path, debug, loo p)
24	options log_level if debug-- True else	
25	options.loopself.loop	
->26	self .session aclruntime.InferenceSession(self,model_path, self. device id, options)	
27	self.outputs names - [meta.name for meta in self.session.get_outputs()1	
28
RuntimeError:[1][ACL:invalid parameter]

麻烦有了解的大佬帮我看一下是哪里出了问题,谢谢!

本帖最后由 匿名用户2024/04/03 14:50:07 编辑

我要发帖子