Git Product home page Git Product logo

Comments (17)

yishunzhijian avatar yishunzhijian commented on September 13, 2024 1

这个是对应位置的缩进不对齐所致,我上传的文件在我本地上都是对齐的,可能有些地方上传后不对齐了,你需要调整一下,再运行eval.py

这修改好之后出现新问题,我觉得下面eval.py程序需要改一下:
if args.cross_class_nms = True:
nms='cross class'
else:
nms='not use cross class'
if args.fast_nms = True:
num_count = num_count + 1
if args.cluster_nms = True:
num_count = num_count + 1
if args.cluster_diounms = True:
num_count = num_count + 1
if args.spm = True:
num_count = num_count + 1
if args.spm_dist = True:
num_count = num_count + 1
if args.spm_dist_weighted = True:

改成
if args.cross_class_nms == True:
nms='cross class'
else:
nms='not use cross class'
if args.fast_nms == True:
num_count = num_count + 1
if args.cluster_nms == True:
num_count = num_count + 1
if args.cluster_diounms == True:
num_count = num_count + 1
if args.spm == True:
num_count = num_count + 1
if args.spm_dist == True:
num_count = num_count + 1
if args.spm_dist_weighted == True:
num_count = num_count + 1

训练出现了新的问题:
Traceback (most recent call last):
File "train.py", line 504, in
train()
File "train.py", line 371, in train
compute_validation_map(epoch, iteration, yolact_net, val_dataset, log if args.log else None)
File "train.py", line 492, in compute_validation_map
val_info = eval_script.evaluate(yolact_net, dataset, train_mode=True)
File "/home/song/CIoU-master/eval.py", line 964, in evaluate
preds = net(batch)
File "/home/song/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, **kwargs)
File "/home/song/CIoU-master/yolact.py", line 676, in forward
return self.detect(pred_outs, self)
File "/home/song/CIoU-master/layers/functions/detection.py", line 76, in call
result = self.detect(batch_idx, conf_preds, decoded_boxes, mask_data, inst_data)
File "/home/song/CIoU-master/layers/functions/detection.py", line 122, in detect
boxes, masks, classes, scores = self.cluster_diounms(boxes, masks, scores, self.nms_thresh, self.top_k)
File "/home/song/CIoU-master/layers/functions/detection.py", line 347, in cluster_diounms
scores, idx = scores.sort(1, descending=True)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
请问这个怎么改?

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

这个是对应位置的缩进不对齐所致,我上传的文件在我本地上都是对齐的,可能有些地方上传后不对齐了,你需要调整一下,再运行eval.py

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

eval.py中,换成其他的nms看看是否会报错,比如fast_nms

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

eval.py中,换成其他的nms看看是否会报错,比如fast_nms

fast_nms好使,可以训练,其他的有相同的问题

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

这就很奇怪了,因为我看你报错是cluster_diounms的第一步scores.sort(1, descending=True),而这一步对fast_nms也是一样的第一步。详情可查看layers/functions/detection.py

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

这就很奇怪了,因为我看你报错是cluster_diounms的第一步scores.sort(1, descending=True),而这一步对fast_nms也是一样的第一步。详情可查看layers/functions/detection.py

其他的nms都可以训练,就这个还是有问题 spm_dist_weighted
Traceback (most recent call last):
File "train.py", line 504, in
train()
File "train.py", line 371, in train
compute_validation_map(epoch, iteration, yolact_net, val_dataset, log if args.log else None)
File "train.py", line 492, in compute_validation_map
val_info = eval_script.evaluate(yolact_net, dataset, train_mode=True)
File "/home/song/CIoU-master/eval.py", line 964, in evaluate
preds = net(batch)
File "/home/song/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call
result = self.forward(*input, *kwargs)
File "/home/song/CIoU-master/yolact.py", line 676, in forward
return self.detect(pred_outs, self)
File "/home/song/CIoU-master/layers/functions/detection.py", line 76, in call
result = self.detect(batch_idx, conf_preds, decoded_boxes, mask_data, inst_data)
File "/home/song/CIoU-master/layers/functions/detection.py", line 128, in detect
boxes, masks, classes, scores = self.cluster_SPM_dist_weighted_nms(boxes, masks, scores, self.nms_thresh, self.top_k)
File "/home/song/CIoU-master/layers/functions/detection.py", line 489, in cluster_SPM_dist_weighted_nms
weights = (B
(B>0.8).float() + torch.eye(n).cuda().expand(80,n,n)) * (scores.unsqueeze(2).expand(80,n,n))
RuntimeError: The size of tensor a (4) must match the size of tensor b (80) at non-singleton dimension 0

detection.py的489行改成 weights = (B*(B>0.8).float() + torch.eye(n).cuda().expand(4,n,n)) * (scores.unsqueeze(2).expand(4,n,n))(scores.unsqueeze(2).expand(4,n,n))就可以训练了

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

请问加入ciou损失和Cluster-NMS后,为什么ap mask的值会提升?我的理解是ap box会提升,因为是对边界框的优化。yolact检测和分割是分开进行的,如何解释ap mask会提升呢?谢谢回复。

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

YOLACT是基于检测的实例分割算法,因此box会影响裁剪出的mask的效果

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

YOLACT是基于检测的实例分割算法,因此box会影响裁剪出的mask的效果

可以讲的具体一点嘛,因为分割分支直接产生mask,似乎和box没什么关系

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

你看NMS的代码,mask是根据box的结果来裁剪的。box越正确,mask的结果也就越正确

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

你看NMS的代码,mask是根据box的结果来裁剪的。box越正确,mask的结果也就越正确

谢谢,那ciou对ap mask的提升怎么理解呢

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

CIoU用于bbox regression,可以提升box的质量

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

CIoU用于bbox regression,可以提升box的质量

非常感谢

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

还有一个小问题,看了一下代码,还是不太清楚ap mask是如何计算的,是计算每个像素吗

from ciou.

yishunzhijian avatar yishunzhijian commented on September 13, 2024

我看到你论文中Balancing precision and recall by different values of β in Cluster-NMS S+D,并且让β等于0.6,但是代码中并没有β的设置

from ciou.

Zzh-tju avatar Zzh-tju commented on September 13, 2024

@yishunzhijianlayers/box_utils.py distance函数

from ciou.

yilifan avatar yilifan commented on September 13, 2024

cluster_nms 出现同样问题,请问您解决了吗

from ciou.

Related Issues (20)

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.