完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好:
按Milk-V Duo开发板实战——基于YOLOv5的目标检测 安装好yolov5环境,在执行main.py的时候会出错,能否帮忙看下 main.py: import torch from models.experimental import attempt_download model = torch.load(attempt_download("./yolov5n.pt"),map_location=torch.device('cpu'))['model'].float() model.eval() model.model[-1].export = True torch.jit.trace(model,torch.rand(1, 3, 640, 640), strict=False).save("./yolov5n_jit.pt") 执行出错的log: (py39_yolov5) D:yolov5-master-milkv>python main.py Traceback (most recent call last): File "D:yolov5-master-milkvmain.py", line 6, in torch.jit.trace(model,torch.rand(1, 3, 640, 640), strict=False).save("./yolov5n_jit.pt") File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchjit_trace.py", line 750, in trace return trace_module( File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchjit_trace.py", line 967, in trace_module module._c._create_method_from_trace( File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesmodule.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesmodule.py", line 1118, in _slow_forward result = self.forward(*input, **kwargs) File "D:yolov5-master-milkvmodelsyolo.py", line 210, in forward return self._forward_once(x, profile, visualize) # single-scale inference, train File "D:yolov5-master-milkvmodelsyolo.py", line 122, in _forward_once x = m(x) # run File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesmodule.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesmodule.py", line 1118, in _slow_forward result = self.forward(*input, **kwargs) File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesupsampling.py", line 154, in forward recompute_scale_factor=self.recompute_scale_factor) File "D:ProgramDataAnaconda3envspy39_yolov5libsite-packagestorchnnmodulesmodule.py", line 1207, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor' 谢谢! |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
H264硬编码CVI_VENC_StartRecvFrame报错的原因?怎么解决?
604浏览 2评论
使用bm-smi查看信息时发现没有程序运行但是设备内存被占用是怎么回事?
340浏览 1评论
349浏览 1评论
SE5盒子如何修改IP?执行bm_set_ip提示没有该命令?
343浏览 1评论
742浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-23 13:43 , Processed in 0.325811 second(s), Total 42, Slave 37 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号