Coder Social home page Coder Social logo

objectdetection_script's Introduction

objectdetection_script's People

Contributors

willert98 avatar z1069614715 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectdetection_script's Issues

预测标签,以及样本不平均的过采样训练方法

魔导,有个问题困扰了很久,我想在coco数据集的基础上加上自己的数据集训练,但是会导致样本标签不平均的问题,能不能出一些权重采样,之类的小trick的视频?另外想问一下如果是预训练模型,比如yolov8s.pt,他已经在coco上训练了,那我在我自定义数据集上训练以后,如何同时也预测之前就学到的标签呢?比如仍然要识别person、bus诸如此类的标签,实验一直没试出来。

预测不出来不知道是不是模型把那些遗忘掉了,还是说需要冻结参数之类的操作,还是因为我配置项的问题,是不是需要修改模型的yaml文件​(好像没成功)

YOLOv7-PConv

PConv may be just useful in only 1 GPU, I run it in two GPUs, it doesn't work. So it can be resolved?

rt-detr-resnet50的预训练文件

博主我跑的u版的rt-detr-resnet50的网络结构是584层,GFLOPs是130.8,博主是修改了u版的代码吧,没有用ResNetlayer,换成了ConvNormLayer?使用resnet50的预训练文件出错了

高版本numpy中存在函数问题

colors = np.random.uniform(0, 255, size=(len(model_names), 3)).astype(np.int)
这句代码在高于1.2版本的numpy中会出现错误AttributeError: module 'numpy' has no attribute 'int'.
将np.int改为int可以解决问题

yolov7 heat_map出现了一个bug

我的yolov7模型需要固定图片的大小为512,512,我更改以下代码:
image
图像有上下的黑边,这是一个情况
image

我尝试提前把图片处理好为512512,再运行代码
只要是512
512的图片就什么输出都没有,进度条为0就终止了,就请问这个yolov7_heatmap有限制图片大小或者该怎么更改这种情况?

Aux OTA报错

tobj[b, a, gj, gi] = (1.0 - self.gr) + self.gr * iou.detach().clamp(0).type(tobj.dtype)  # iou ratio
RuntimeError: shape mismatch: value tensor of shape [71, 1] cannot be broadcast to indexing result of shape [71]

OTA报错

  File "/home/gem/utils/loss_OTA.py", line 291, in __call__
    tobj[b, a, gj, gi] = (1.0 - self.gr) + self.gr * iou.detach().clamp(0).type(tobj.dtype)  # iou ratio
RuntimeError: shape mismatch: value tensor of shape [57, 1] cannot be broadcast to indexing result of shape [57]

yolov8-track.py的问题

代码72行 tracker.update(mot_input, image_plot)报错,显示AssertionError: Unsupported 'dets' dimensions, valid number of dimensions is two。

YOLOV8图像分割

作图像分割的的同学可以把画预测框的地方138行注释掉就可以使用了

RuntimeError: shape mismatch: value tensor of shape [41, 1] cannot be broadcast to indexing result of shape [41]

大佬,在添加OTA中,拉的版本是yolov5 7.0 按照视频步骤,还是有如下问题
Traceback (most recent call last):
File "/home//yolov5/train.py", line 634, in
main(opt)
File "/home//yolov5/train.py", line 528, in main
train(opt.hyp, opt, device, callbacks)
File "/home//yolov5/train.py", line 310, in train
loss, loss_items = compute_loss(pred, targets.to(device),imgs) # loss scaled by batch_size
File "/home//yolov5/utils/loss.py", line 300, in call
tobj[b, a, gj, gi] = (1.0 - self.gr) + self.gr * iou.detach().clamp(0).type(tobj.dtype) # iou ratio
RuntimeError: shape mismatch: value tensor of shape [41, 1] cannot be broadcast to indexing result of shape [41]

yolov7-NWD

Hi, in yolov7-NWD.py,“tbox” may be replaced with "seleted_tbox"?

iou代码疑惑

iou = bbox_iou(pbox, tbox[i], CIoU=True)
这部分后面为什么不用加.squeeze()呢

NWD_based NMS

想请教一下up主,怎么修改nms为基于NWD的呢?原文里面有提到,但是没找到源代码

老师您好,我将你复现的项目拉到程序中最后val.py报错了

Fusing layers...
Traceback (most recent call last):
File "val.py", line 399, in
main(opt)
File "val.py", line 372, in main
run(**vars(opt))
File "C:\Users\hoshi\miniconda3\envs\air\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "val.py", line 141, in run
model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data)
File "I:\AIR\models\common.py", line 492, in init
model = attempt_load(weights if isinstance(weights, list) else w, map_location=device)
File "I:\AIR\models\experimental.py", line 98, in attempt_load
model.append(ckpt.fuse().eval() if fuse else ckpt.eval()) # fused or un-fused model in eval mode
File "I:\AIR\models\yolo.py", line 282, in fuse
m.fuse_repvgg_block()
File "C:\Users\hoshi\miniconda3\envs\air\lib\site-packages\torch\nn\modules\module.py", line 1177, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
我拉到的项目不是yolov5原作,而是yoloair里面,你方便帮我看看是个什么原因么

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

Transferred 348/349 items
0%| | 0/504 [00:00<?, ?it/s]
Traceback (most recent call last):
File "yolov5_heatmap.py", line 117, in
model(r'E:\test\envyolo5\yolov5C3\datasets\00194.jpg', 'result')
File "yolov5_heatmap.py", line 81, in call
score.backward(retain_graph=True)
File "E:\test\envyolo5\lib\site-packages\torch\tensor.py", line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "E:\test\envyolo5\lib\site-packages\torch\autograd_init_.py", line 147, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 3, 20, 20, 7]], which is output 0 of SigmoidBackward, is at version 2; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

请问UP这个怎么破,谢谢

关于WIoU损失函数

elif scale:
      return getattr(WIoU_Scale, '_scaled_loss')(self), (1 - iou) * torch.exp((rho2 / c2)), iou
else:
       return iou, torch.exp((rho2 / c2)) # WIoU v1

您好,请问两个问题:1.为什么返回多个iou损失?2.iou的均值iou_mean在WIoU_Scale里是怎么计算的?

在yolov5中加入了CloAttention注意力机制报错

我用的是YOLOv5s模型为基础,在backbone第九层加入了CloAttention,照着视频里的做法,修改了yolo.py文件,但是训练的时候报错:
"RuntimeError: shape '[28, 2, -1, 64, 24]' is invalid for input of size 286720"
错误发生在第77行:
“kv = to_kv(kv).view(b, 2, -1, self.dim_head, (h*w)//(self.window_size**2)).permute(1, 0, 2, 4, 3).contiguous() #(2 b m (H W) d)”
是维度错误,每一轮训练结束后的验证阶段开始的时候报错.

yolov7+DCNv3 训练时报错:RuntimeError: Not implemented on the CPU

`File "/home/undergraduate/anaconda3/envs/yolov7p/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 110, in decorate_fwd
return fwd(*args, **kwargs)
File "/media/kb541/ruanpuchao/yolov7_train/models/ops_dcnv3/functions/dcnv3_func.py", line 39, in forward
output = DCNv3.dcnv3_forward(

RuntimeError: Not implemented on the CPU`

我按照视频将DCNv3添加到了yolov7网络中,但是当我开始训练的时候,程序报错RuntimeError: Not implemented on the CPU,我的命令行输入为:python track.py --device 0,1 --epoch 100 --batch_size 32,按理说不会再cpu上运行模型的啊,为什么报这个错误呢?谢谢。

errno13 permission denied

导师你好,yolov5-7.0测试时老报错,麻烦您看一下。
`Speed: 1.1ms pre-process, 16.7ms inference, 4.0ms NMS per image at shape (1, 3, 640, 640)

Evaluating pycocotools mAP... saving runs\val\exp17\best_predictions.json...
pycocotools unable to run: [Errno 13] Permission denied: 'C:\Users\admin\Desktop\yolov5-7.0'
Results saved to runs\val\exp17
loading annotations into memory...

Process finished with exit code 0`

S2Attention bug?

class S2Attention(nn.Module):
def init(self, channels=512):
super().init()
self.mlp1 = nn.Linear(channels, channels * 3)
self.mlp2 = nn.Linear(channels, channels)
self.split_attention = SplitAttention()

这一行:
self.split_attention = SplitAttention()
好像要改为:
self.split_attention = SplitAttention(channels)
否则会报“矩阵乘法”相关的错误

(即,class SplitAttention(nn.Module): 里的
hat_a = self.mlp2(self.gelu(self.mlp1(a))) # bs,kc
不运行?)

yolov7改进(加注意力机制)

请问可以更新添加CA.py注意力机制的代码吗?我在github找的CA.py的源代码按照你的方法添加一直报错(我是选择在Concat后面加注意力机制),报错如下:

Traceback (most recent call last):
File "/hone/hndx/11z/yolow7-main-sE_cA/models/yolo. py",1ine 830, in
model=Model(opt. cfg). to(device)
File"/home/hudx/11z/yolow7-main-sE CA/nmodels/yolo. py", line 528, in init.
self. model, self. save=parse. model(deepcopy(seLf. yamt), ch=[ ch])# model, savelist
File "/home/hndx/LLz/yolayZ-main-SE CA/modets/yotopy", line 806, in parse_model m=nn. Sequential([m( args) forin range(n)]) if n>1 else m(* args)# module
FiLe "/home/hnex/11z/yoLov7-main-SE CA/models/comon. py", Line 69, in __init __
seLf. att=CoordAtt(channel
TypeError: init-() missing 1 required positionat argument:' oup'

希望作者可以帮忙解答,谢谢

no "backbone" in yaml file in yolo_v8_heatmap

I receive an error when there is no "backbone" in the yolo_v8 yaml config. Would like to ask if you can provide example yaml config files?

/yolov8_heatmap.py in __init__(self, weight, cfg, device, method, layer, backward_type, conf_threshold, ratio)
    52         model_names = ckpt['model'].names
    53         csd = ckpt['model'].float().state_dict()  # checkpoint state_dict as FP32
--> 54         model = Model(cfg, ch=3, nc=len(model_names)).to(device)
    55         csd = intersect_dicts(csd, model.state_dict(), exclude=['anchor'])  # intersect
    56         model.load_state_dict(csd, strict=False)  # load

/opt/conda/lib/python3.8/site-packages/ultralytics/nn/tasks.py in __init__(self, cfg, ch, nc, verbose)
    174             LOGGER.info(f"Overriding model.yaml nc={self.yaml['nc']} with nc={nc}")
    175             self.yaml['nc'] = nc  # override yaml value
--> 176         self.model, self.save = parse_model(deepcopy(self.yaml), ch=ch, verbose=verbose)  # model, savelist
    177         self.names = {i: f'{i}' for i in range(self.yaml['nc'])}  # default names dict
    178         self.inplace = self.yaml.get('inplace', True)

/opt/conda/lib/python3.8/site-packages/ultralytics/nn/tasks.py in parse_model(d, ch, verbose)
    437     ch = [ch]
    438     layers, save, c2 = [], [], ch[-1]  # layers, savelist, ch out
--> 439     for i, (f, n, m, args) in enumerate(d['backbone'] + d['head']):  # from, number, module, args
    440         m = getattr(torch.nn, m[3:]) if 'nn.' in m else globals()[m]  # get module
    441         for j, a in enumerate(args):

KeyError: 'backbone'

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.