首页 > 其他分享 >height_scale = scales[2] IndexError: index 2 is out of bounds for axis 0 with size 0

height_scale = scales[2] IndexError: index 2 is out of bounds for axis 0 with size 0

时间:2024-05-30 18:23:41浏览次数:15  
标签:index yolov5 scale IndexError focus out size

1.yolov5网络层优化

在yolov5训练之前最好是改一下网络层,要不会报这个错。

Traceback (most recent call last):
  File "convertCaffe.py", line 159, in <module>
    convertToCaffe(graph, prototxt_path, caffemodel_path, exis_focus=True, focus_concat_name="Concat_40", focus_conv_name="Conv_41")
  File "convertCaffe.py", line 83, in convertToCaffe
    layer = converter_fn(node, graph, err)
  File "/home/admin/code/yolov5_onnx2caffe/onnx2caffe/_operators.py", line 505, in _convert_resize
    height_scale = scales[2]
IndexError: index 2 is out of bounds for axis 0 with size 0

    1
    2
    3
    4
    5
    6
    7
    8

因为我用的是yolov5s模型所以更改yolov5/models/yolov5s.yaml
将yolov5的focus层替换为conv层(stride为2),upsample层替换为deconv层
(反卷积层),因为caffe不支持focus层。

 

file:///root/Pictures/1814838874.jpg

 


————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                        
原文链接:https://blog.csdn.net/qq_44181970/article/details/118094771

标签:index,yolov5,scale,IndexError,focus,out,size
From: https://www.cnblogs.com/eastgeneral/p/18222994

相关文章

  • [论文阅读] FontDiffuser@ One-Shot Font Generation via Denoising Diffusion with M
    Pretitle:FontDiffuser:One-ShotFontGenerationviaDenoisingDiffusionwithMulti-ScaleContentAggregationandStyleContrastiveLearningaccepted:AAAI2024paper:https://arxiv.org/abs/2312.12142code:https://github.com/yeungchenwa/FontDiffuserref:......
  • Power and sample size应用在概率题
    Statisticalpower统计功效是统计检验否定假原假设的概率。我们把拒绝正确nullhypothsis的错误称为typeIerror(\(\alpha\))把没有拒绝错误的nullhypothesis的错误称为typeIIerror(\(\beta\))Samplesize1.BioarchaeologyH0:thwownerofthefemurwasfemale......
  • error Conflict: Multiple assets emit different content to the same filename ind
    ERRORFailedtocompilewith1error20:32:04errorConflict:Multipleassetsemitdifferentcontenttothesamefilenameindex.htmlERRORinConflict:Multipleassetsemitdif......
  • 关于size_t
    size_t是什么?为什么要使用它?首先,我们给出size_t的定义:size_t的全称是sizetype,即“记录大小的数据类型”,是sizeof运算结果的类型,一个unsigned整型。以防万一,sizeof(chr)返回的是变量或类型在内存中占用的字节数。size_t被用在哪里?c库中的许多函数会使用size_t,请看如下函数......
  • AI菜鸟向前飞 — LangChain系列之十二 - RAG(下篇):Index和Retriever
    AI菜鸟向前飞—LangChain系列之十-RAG(上篇)AI菜鸟向前飞—LangChain系列之十一-RAG(中篇)先分享个问题的解法#在使用Chroma实例化过程中,可能会出现如下报错AttributeError:typeobject'hnswlib.Index'hasnoattribute'file_handle_count'当使用代码遇到如上问......
  • lua 元表__index 元方法应用1
    1--普通表2localtab={1,2,3}34--元表5localmeta={6insert=function(t,v)7--监测表增加成员8print("增加一个值",v)9table.insert(t,v)10end,11remove=function(t,i)12--监测表删除成......
  • [LeetCode] 2903. Find Indices With Index and Value Difference I
    Youaregivena0-indexedintegerarraynumshavinglengthn,anintegerindexDifference,andanintegervalueDifference.Yourtaskistofindtwoindicesiandj,bothintherange[0,n-1],thatsatisfythefollowingconditions:abs(i-j)>=index......
  • Tensors of the same index must be on the same device and the same dtype except `
    避免使用 torch.set_default_dtype(torch.float64) 可以尝试采用model.Double或者model.to(torch.Double)m=torch().to(device).to(torch.float64)     参考:Tensorsofthesameindexmustbeonthesamedeviceandthesamedtypeexcept`step`t......
  • Further Generalizations of the Jaccard Index
    目录概JaccardIndex推广到multisets推广到MultiplesetsCostaL.Furthergeneralizationsofthejaccardindex.2021.概本文介绍了JaccardIndex(JaccardSimilarity),和它的一些变种.JaccardIndex对于两个普通的集合\(A,B\),它们的JaccardIndex为\[J(......
  • 全球2023年自然科学指数(Nature Index),各单位排名表
    地址:https://www.nature.com/nature-index/annual-tables/2023/institution/all/all/global自然科学指数(NatureIndex)大揭秘!近日,自然指数官网更新自然指数排名数据(统计时间节点为2022.11.1-2023.10.31),中国高校表现依旧强势。统计结果显示,重庆大学进入全球排名TOP200,位列全球......