Giter VIP home page Giter VIP logo

positive666 / yolo_research Goto Github PK

View Code? Open in Web Editor NEW
738.0 11.0 142.0 24.93 MB

based on yolo-high-level project (detect\pose\classify\segment\):include yolov5\yolov7\yolov8\ core ,improvement research ,SwintransformV2 and Attention Series. training skills, business customization, engineering deployment C

License: GNU General Public License v3.0

Dockerfile 0.16% Shell 0.61% Python 99.23%
yolov5 deepstream pytorch object-detection attention-mechanism swintransformer custom-networ yolov7 yolov8

yolo_research's People

Contributors

ab-101 avatar aehogan avatar albinxavi avatar alexstoken avatar alexwang1900 avatar anon-artist avatar ayushexel avatar borda avatar bzha5848 avatar dependabot-preview[bot] avatar developer0hye avatar dlawrences avatar edurenye avatar glenn-jocher avatar kinoute avatar laughing-q avatar lorenzomammana avatar lornatang avatar nanocode012 avatar olehb avatar ownmarc avatar positive666 avatar taoxiesz avatar tkianai avatar toretak avatar wanghaoyang0106 avatar youngjinshin avatar yuriribeiro avatar yxnong avatar zzttqu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yolo_research's Issues

运行时common.py报错

报错:AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'C:\Users\86153\yolov5-mosaic9\models\common.py'>

Decoupled Head

❔Question

博主大大您好,我在使用您的decoupled head 进行实验,采用yolov5s_decoupled.yamy,训练了65个epoch(batch size = 4,其余参数未修改),在visdrone数据集上验证集的map0.5只有0.143,是我什么地方有缺漏忘记调整了吗?

Additional context

附上我的实验结果如下
Epoch gpu_mem box obj cls labels img_size
64/64 1.19G 0.09373 0.1588 0.02641 388 640: 100%|██████████| 1618/1618 [02:45<00:00, 9.75it/s]
Class Images Labels P R [email protected] [email protected]:.95: 100%|██████████| 69/69 [00:08<00:00, 7.75it/s]
all 548 38759 0.282 0.215 0.143 0.0459

Improvement of the training section

❔Question

您好,之前跟您在博客上沟通过,看到您开了ISSUE,我按照您的改进思路,想在LOSS和标签匹配上做一下改进,但是我现在没有什么思路,您能再分享下或者一些改进这部分代码上的工作吗?

Additional context

导入其他的C3模块报错

你好,在实验中使用C3模块是可以的,使用其他的融合的C3模块就报这样的错误:TypeError: empty(): argument 'size' must be tuple of ints, but found element of type float at pos 2 这是什么原因呢

Carafe

❔Question

你好,我在尝试采用carafe算子进行训练时,报错如下:
yolo.py in parse_model
c2_ = make_divisible(c2 * gw, 8)
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
请问该如何解决呢?是哪里没设置对吗?

Additional context

yolov5s_swinv2_head.yaml配置运行报错

❔Question

请问完全按照项目文件设置,在自己的数据集上,使用yolov5s_swinv2_head.yaml文件,总是显示以下错误:
RuntimeError: Given groups=1, weight of size [1024, 128, 1, 1], expected input[1, 32, 32, 128] to have 128 channels, but got 32 channels instead
没有自己改动,貌似是输入维度不匹配问题,但是找不到根源在哪,求教。

Additional context

decoupled head 问题

我把您的Decoupled Head 移植到到了我的代码里。修改了common.py 和yolo.py.我运行yolo.py测试网络是否可以正常forward,但出现了以下问题:

28 [19, 23, 27] 1 7337351 Decoupled_Detect [10, [[18, 14, 12, 26, 23, 20], [33, 24, 19, 44, 45, 34], [66, 49, 104, 73, 168, 136]], [216, 216, 416]]

<class 'NoneType'> None

Traceback (most recent call last):
File "/workspace/xdy/yolov5/models/yolo.py", line 689, in
model = Model(opt.cfg,opt.feature).to(device)
File "/workspace/xdy/yolov5/models/yolo.py", line 332, in init
m.stride = torch.tensor([s / x.shape[-2] for x in self.forward(torch.zeros(1, ch, s, s))]) # forward
File "/workspace/xdy/yolov5/models/yolo.py", line 355, in forward
return self._forward_once(x, profile, visualize) # single-scale inference, train
File "/workspace/xdy/yolov5/models/yolo.py", line 378, in _forward_once
x = m(x) # run
File "/root/miniconda3/envs/torch17/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/xdy/yolov5/models/yolo.py", line 57, in forward
bs, _, ny, nx = x[i].shape # x(bs,255,20,20) to x(bs,3,20,20,85)
AttributeError: 'NoneType' object has no attribute 'shape'

class Decoupled_Detect中的forward 的 x[i]是个空值 用原来的detect倒是正常,求作者大大指教

作者您好,您在自己的数据集上测试过biFPN吗?效果怎样

在官方yolov5-v6.0中的models/hub文件夹下,作者提供了一个yolov5-bifpn.yaml模型配置文件。我看了下,官方作者只在head的检测中等目标(medium)的检测头加入了bifpn,请问作者您知道怎么在小目标检测头也添加bifpn吗?如果您有相关的yaml文件,可以提供一下吗?谢谢
我问的配置文件的链接:https://github.com/ultralytics/yolov5/blob/v6.0/models/hub/yolov5-bifpn.yaml

训练时出现keyError

AutoAnchor: 5.36 anchors/target, 1.000 Best Possible Recall (BPR). Current anchors are a good fit to dataset ✅
Traceback (most recent call last):
File "train.py", line 678, in
main(opt)
File "train.py", line 575, in main
train(opt.hyp, opt, device, callbacks)
File "train.py", line 305, in train
compute_loss = ComputeLoss(model) # init loss class
File "/home/wch/yolov5_research/utils/loss.py", line 107, in init
self.g2=h['fl_eiou_gamma'] # focal eiou loss gamma
KeyError: 'fl_eiou_gamma'
请问是啥情况

Swin transformer

❔Question

Additional context

我想问一下用您的V2版本的yaml去做训练,发现模型比较难训练,这种的话怎么去解决

botnet的添加问题

❔Question

我发现博主大大再添加mhsa时后面并未加BN和silu层,这是有什么深意吗?

Additional context

您好,请问下mhsa使用位置编码,调试显示content和position维度相同,但运行会报维度不匹配的问题是什么原因呢

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

import torch

a = torch.tensor([5])
c = a / 0

Output:

Traceback (most recent call last):
  File "/Users/glennjocher/opt/anaconda3/envs/env1/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-be04c762b799>", line 5, in <module>
    c = a / 0
RuntimeError: ZeroDivisionError

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

  • OS: [e.g. Ubuntu]
  • GPU [e.g. 2080 Ti]

Additional context

Add any other context about the problem here.

关于自己的数据训练问题汇总

问题反馈:无法加载自己数据文件txt,无法生成.cache文件,在dataset.py中,第512行
image

解决方法:要把img_files改为im_files即可

解耦头的作用

❔Question

大佬,能不能讲解一下这个解耦头的作用呀?很想学习一下,麻烦您了

Additional context

如何使用您git里说的deepstream?

❔Question

我需要一个实时的部署要求,按照操作,编译报错了。我调试了很久,希望您能更新添加一下使用说明

Additional context

解耦头

❔Question

我看见用来解耦头之后和yolov5s比对,计算量增加一点,参数量降低了,请问一下FPS大概降低了多少呢

Additional context

SWIN

❔Question

Additional context您好,我想问一下,如果SWIN V2不好训练的话,您有采用拿SWIN 1.0版去修改吗?

Decoupled_Detect

AttributeError: 'DecoupledHead' object has no attribute 'bias'

看着您的common和yolo文件改的,但不知道为啥报了这个错。

为什么我将代码整个拉去下来,好多地方是错的啊

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

import torch

a = torch.tensor([5])
c = a / 0

Output:

Traceback (most recent call last):
  File "/Users/glennjocher/opt/anaconda3/envs/env1/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-be04c762b799>", line 5, in <module>
    c = a / 0
RuntimeError: ZeroDivisionError

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

  • OS: [e.g. Ubuntu]
  • GPU [e.g. 2080 Ti]

Additional context

Add any other context about the problem here.

添加SE注意力机制

❔Question

Additional context

我在主干网络的C3模块后面添加SE-Net注意力机制,但是运行detect.py时报如下错误:RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 28 but got size 27 for tensor number 1 in the list.

运行detect.py报错

❔Question

作者大大,我在训练完自己的数据集后,在detect.py里载入训练好的权重后运行,结果报错:AttributeError: 'DetectMultiBackend' object has no attribute 'fp16',这是怎么回事呀

Additional context

GAM调用shuffleNet中的channel_shuffle参数有误

def channel_shuffle(self, x, groups=2):
#RESHAPE----->transpose------->Flatten
B, C, H, W = x.shape
out = x.view(B, groups, C // groups, H, W).permute(0, 2, 1, 3, 4).contiguous()
out=out.view(B, C, H, W)
return out

GAM:
x_spatial_att = self.spatial_attention(x).sigmoid()
x_spatial_att=channel_shuffle(x_spatial_att,4)
out = x * x_spatial_att
return out

🐛 Bug

x_spatial_att -> self , x -> int

去掉self能跑起来

Doecoupled Head

❔Question

可以具体讲一下代码里解耦头具体的方法过程吗

Additional context

很清楚啊 就是在head部分加两个分支的卷积组 一个分支:分类 ,另一个分支:回归和前景置信度 然后在CAT回去 就可以了 类似于YOLOX,里面可以作卷积核微调 因为FLOPs明显增大了 后续会在CSDN上作详细说明

decouple

❔Question

您好,我采用您的swin-head和decouple的yaml,二者结合起来,然后在多个服务器上训练,大概在100epch上出现结果全为0的状态

Additional context

image

GAM调用shuffleNet中的channel_shuffle参数有误

def channel_shuffle(self, x, groups=2):
#RESHAPE----->transpose------->Flatten
B, C, H, W = x.shape
out = x.view(B, groups, C // groups, H, W).permute(0, 2, 1, 3, 4).contiguous()
out=out.view(B, C, H, W)
return out

GAM:
x_spatial_att = self.spatial_attention(x).sigmoid()
x_spatial_att=channel_shuffle(x_spatial_att,4)
out = x * x_spatial_att
return out

🐛 Bug

x_spatial_att -> self , x -> int

去掉self能跑起来

运行ASFF_Detect出错

❔Question

Additional context

大佬,我加了ASFF_Detect,出现报错,ASFF AttributeError: 'Model' object has no attribute 'stride',请问怎么解决,用的是github上的代码

关于detect.py中from utils.dataloaders import create_dataloader import IMG_FORMATS, VID_FORMATS, LoadImages, LoadStreams有错误,我按照源码改了还是不行

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

import torch

a = torch.tensor([5])
c = a / 0

Output:

Traceback (most recent call last):
  File "/Users/glennjocher/opt/anaconda3/envs/env1/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-be04c762b799>", line 5, in <module>
    c = a / 0
RuntimeError: ZeroDivisionError

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

  • OS: [e.g. Ubuntu]
  • GPU [e.g. 2080 Ti]

Additional context

Add any other context about the problem here.

yolo.py运行yolov5-transformer.yaml报错

作者大大,我从您的model/hub 文件和yolov5原作者的代码里现在mater版本的model/hub里加载yolov5-transformer.yaml,运行yolo.py都出现了报错:TypeError: new(): argument 'size' must be tuple of ints, but found element of type float at pos 2,这是什么原因呀?

RuntimeError: expected scalar type Float but found Half

Epoch gpu_mem box obj cls labels img_size
0/199 4.87G 0.1106 0.01998 0 13 640: 100%|██████████| 567/567 [01:50<00:00, 5.14it/s]
Class Images Labels P R [email protected] [email protected]:.95: 0%| | 0/78 [00:00<?, ?
Traceback (most recent call last):
File "train.py", line 675, in
main(opt)
File "train.py", line 572, in main
train(opt.hyp, opt, device, callbacks)
File "train.py", line 396, in train
results, maps, _ = val.run(data_dict,
RuntimeError: expected scalar type Float but found Half
大佬,所有的swin都会出现这个问题是什么原因呢

SWINV2

❔Question

Additional context

博主您好,现在swinV2已经开源了,您的SWINV2的backbone如何去使用官方的V2的预训练权重呢

模型搭建,会报错 0 -1 1 3264 models.common.PatchEmbed [4, 3, 64] D:\conda\envs\py630\lib\site-packages\torch\functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\bu ilder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2895.)

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Input:

import torch

a = torch.tensor([5])
c = a / 0

Output:

Traceback (most recent call last):
  File "/Users/glennjocher/opt/anaconda3/envs/env1/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-be04c762b799>", line 5, in <module>
    c = a / 0
RuntimeError: ZeroDivisionError

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

  • OS: [e.g. Ubuntu]
  • GPU [e.g. 2080 Ti]

Additional context

Add any other context about the problem here.

关于解耦头

您好,我想把您的解耦头移植到我的v5代码里,但是我把common.py里的DecoupledHead以及 yolo.py修改好后训练时报错是哪里还没改对吗:
image

将yolos-asff改成yolom-asff或yolol-asff问题

❔Question

我将yolos-asff改成yolom-asff报错这个问题,请教一下修改思路,是不是要在yolo.py和common里对asff进行特定的修改呢?
Given groups=1, weight of size [128, 512, 1, 1], expected input[1, 768, 8, 8] to have 512 channels, but got 768 channels instead
万分感谢您!!我的邮箱是[email protected] 如果方便可以邮箱交流下!谢谢!!

Additional context

BoT

❔Question

感觉BoT好像不如C3块和C3TR块,可以减少参数量但会拉低一部分精度啊

Additional context

About DCN+yolov5

❔Question

Dear Writer, would you like to add DCN moudel into this YOLOv5 project? If you have created it, where can I find it?

Additional context

x6+ASFF报错

❔Question

将x6模型文件的检测层,替换成ASFF_Detect报错,请问现在ASFF还不支持P6系列的模型吗?

Additional context

SwinV2.yaml运行报错

❔Question

File "D:\Python\yolov5\utils\datasets.py", line 420, in init
cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict

Additional context

作者您好,请问仓库拉取后跑SwinV2.yaml为什么报错啊,是目前没有上传完整吗?而且我看到计算量很大,请问作者您试过将SwinTransformer作为类似C3卷积块的算子替换C3吗

解耦头

❔Question

Additional context

按您修改的解耦头改到自己代码还是报错,显示 self.m = nn.ModuleList(DecoupledHead(x,nc,anchors) for x in ch) if self.decoupled else nn.ModuleList(nn.Conv2d(x, self.no * self.na, 1) for x in ch) # output conv
TypeError: 'bool' object is not iterable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.