Git Product home page Git Product logo

Comments (22)

maxin1228 avatar maxin1228 commented on May 14, 2024

我也是这个错误,请问您解决了吗?

from yolov4-pytorch.

gaasing avatar gaasing commented on May 14, 2024

补充问题

[2020-10-08 00:18:22,876]-[train.py line:147]: === Epoch:[ 0/300],step:[9980/9999],img_size:[416],total_loss:107.6754|loss_ciou:29.1679|loss_conf:38.5639|loss_cls:39.9436|lr:0.0000
[2020-10-08 00:18:30,749]-[train.py line:147]: === Epoch:[ 0/300],step:[9990/9999],img_size:[416],total_loss:107.6427|loss_ciou:29.1635|loss_conf:38.5499|loss_cls:39.9293|lr:0.0000
[2020-10-08 00:18:37,893]-[train.py line:164]:===== Validate =====

此前训练一个epoch没有报这个错误,但是结束这一epoch后提示Validate后就停止了?

from yolov4-pytorch.

argusswift avatar argusswift commented on May 14, 2024

[2020-10-08 15:59:54,446]-[train.py line:147]: === Epoch:[ 0/300],step:[3340/9999],img_size:[416],total_loss:152.8582|loss_ciou:32.0746|loss_conf:59.5948|loss_cls:61.1885|lr:0.0000
[2020-10-08 16:00:02,392]-[train.py line:147]: === Epoch:[ 0/300],step:[3350/9999],img_size:[416],total_loss:152.6998|loss_ciou:32.0685|loss_conf:59.5150|loss_cls:61.1160|lr:0.0000
Traceback (most recent call last):
File "train.py", line 211, in
fp_16=opt.fp_16).train()
File "train.py", line 113, in train
for i, (imgs, label_sbbox, label_mbbox, label_lbbox, sbboxes, mbboxes, lbboxes) in enumerate(self.train_dataloader):
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 363, in next
data = self._next_data()
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 403, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/amax/lf2/YOLOv4-pytorch/utils/datasets.py", line 50, in getitem
label_sbbox, label_mbbox, label_lbbox, sbboxes, mbboxes, lbboxes = self.__creat_label(bboxes)
File "/home/amax/lf2/YOLOv4-pytorch/utils/datasets.py", line 173, in __creat_label
label[best_detect][yind, xind, best_anchor, 0:4] = bbox_xywh
IndexError: index 52 is out of bounds for axis 1 with size 52

请问这是什么错误,应该如何解决?

索引超出数组长度,你可以检查一下train_annotation.txt里是否有类别超出分类类别数

from yolov4-pytorch.

gaasing avatar gaasing commented on May 14, 2024

[2020-10-08 15:59:54,446]-[train.py line:147]: === Epoch:[ 0/300],step:[3340/9999],img_size:[416],total_loss:152.8582|loss_ciou:32.0746|loss_conf:59.5948|loss_cls:61.1885|lr:0.0000
[2020-10-08 16:00:02,392]-[train.py line:147]: === Epoch:[ 0/300],step:[3350/9999],img_size:[416],total_loss:152.6998|loss_ciou:32.0685|loss_conf:59.5150|loss_cls:61.1160|lr:0.0000
Traceback (most recent call last):
File "train.py", line 211, in
fp_16=opt.fp_16).train()
File "train.py", line 113, in train
for i, (imgs, label_sbbox, label_mbbox, label_lbbox, sbboxes, mbboxes, lbboxes) in enumerate(self.train_dataloader):
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 363, in next
data = self._next_data()
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 403, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/amax/anaconda3/envs/yolov5/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/amax/lf2/YOLOv4-pytorch/utils/datasets.py", line 50, in getitem
label_sbbox, label_mbbox, label_lbbox, sbboxes, mbboxes, lbboxes = self.__creat_label(bboxes)
File "/home/amax/lf2/YOLOv4-pytorch/utils/datasets.py", line 173, in __creat_label
label[best_detect][yind, xind, best_anchor, 0:4] = bbox_xywh
IndexError: index 52 is out of bounds for axis 1 with size 52
请问这是什么错误,应该如何解决?

索引超出数组长度,你可以检查一下train_annotation.txt里是否有类别超出分类类别数

您好,经检查train_annotation.txt分类数没有超出,还是会出现上述问题,但是不是总是出现,有时候能完整训练一个epoch

from yolov4-pytorch.

gaasing avatar gaasing commented on May 14, 2024

我也是这个错误,请问您解决了吗?

还没有解决

from yolov4-pytorch.

April4lu avatar April4lu commented on May 14, 2024

我也是这个错误,请问您解决了吗?

还没有解决

可以看看config/yolov4_config.py中"DATA_TYPE"参数的设置是否为coco 或 voc

from yolov4-pytorch.

gaasing avatar gaasing commented on May 14, 2024

我也是这个错误,请问您解决了吗?

还没有解决

可以看看config/yolov4_config.py中"DATA_TYPE"参数的设置是否为coco 或 voc

谢谢你,我是训练自己的数据集,格式转成了VOC,DATA_TYPE设置的是Custom,现在改成VOC试试。

from yolov4-pytorch.

gaasing avatar gaasing commented on May 14, 2024

我也是这个错误,请问您解决了吗?

还没有解决

可以看看config/yolov4_config.py中"DATA_TYPE"参数的设置是否为coco 或 voc

还是同样的问题

from yolov4-pytorch.

xiaxiajiuzhe avatar xiaxiajiuzhe commented on May 14, 2024

IndexError: index 52 is out of bounds for axis 1 with size 26我也遇到了这个错!!!!

from yolov4-pytorch.

mei-727 avatar mei-727 commented on May 14, 2024

我也遇到了同样的问题,请问有人解决了吗?

from yolov4-pytorch.

hailuo0112 avatar hailuo0112 commented on May 14, 2024

2020-10-27 09-58-16 的屏幕截图
这个问题是因为这里的xind,yind有一个越界,比如训练图像大小设为608的话,第一级anchor的stride是8,所以特征图大小为76*76。这里的xind,yind的范围应该为[0-75],而计算出来的xind,yind会出现76,导致越界

from yolov4-pytorch.

hailuo0112 avatar hailuo0112 commented on May 14, 2024

在datasets.py 文件

from yolov4-pytorch.

yqs666 avatar yqs666 commented on May 14, 2024

在datasets.py 文件

应该如何改动呢?

from yolov4-pytorch.

Amyer0809 avatar Amyer0809 commented on May 14, 2024

如果是训练自己的数据的过程中出现上述错误,请使用作者提供的第三类别,将其中的类容更改为自己需要的类别及数量(即Customer_DATA),不要自己新建一个类别,即可解决上述报错

from yolov4-pytorch.

Imagery007 avatar Imagery007 commented on May 14, 2024

如果是训练自己的数据的过程中出现上述错误,请使用作者提供的第三类别,将其中的类容更改为自己需要的类别及数量(即Customer_DATA),不要自己新建一个类别,即可解决上述报错

我无论是改动VOC_DATA还是使用Customer_DATA都会出现这个问题.....

from yolov4-pytorch.

ishantbansal avatar ishantbansal commented on May 14, 2024

facing same issue ..
If anybody has figured out please share

from yolov4-pytorch.

jingtianyilong avatar jingtianyilong commented on May 14, 2024

have you guys check if the bbox is actually out of the image?

facing same issue ..
If anybody has figured out please share

from yolov4-pytorch.

indigohana avatar indigohana commented on May 14, 2024

你好,我也遇到了这个问题,然后我在datasets.py进行了改动,对xind/yind的上下限进行了判断:
if int(xind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(xind) < 0: xind = 0 if int(yind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(yind) < 0: yind = 0
但是训练出来效果很差,请问有朋友解决了吗?

from yolov4-pytorch.

jingtianyilong avatar jingtianyilong commented on May 14, 2024

你好,我也遇到了这个问题,然后我在datasets.py进行了改动,对xind/yind的上下限进行了判断:
if int(xind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(xind) < 0: xind = 0 if int(yind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(yind) < 0: yind = 0
但是训练出来效果很差,请问有朋友解决了吗?

Like I said. Check your bbox. You would find out that they are out of the image. Clip them to the bound and your are good to go.

from yolov4-pytorch.

indigohana avatar indigohana commented on May 14, 2024

你好,我也遇到了这个问题,然后我在datasets.py进行了改动,对xind/yind的上下限进行了判断:
if int(xind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(xind) < 0: xind = 0 if int(yind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(yind) < 0: yind = 0
但是训练出来效果很差,请问有朋友解决了吗?

Like I said. Check your bbox. You would find out that they are out of the image. Clip them to the bound and your are good to go.

你好,因为我使用的是清洗后的公开数据集,按照方法转化为train_annotation和test_annotation后出现了大概一百多张左右的负坐标情况,我不清楚我对bbox的私人更改是否会影响到后续的评价指标,所以我按照上述对其越界进行了判断。

from yolov4-pytorch.

jingtianyilong avatar jingtianyilong commented on May 14, 2024

你好,我也遇到了这个问题,然后我在datasets.py进行了改动,对xind/yind的上下限进行了判断:
if int(xind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(xind) < 0: xind = 0 if int(yind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(yind) < 0: yind = 0
但是训练出来效果很差,请问有朋友解决了吗?

Like I said. Check your bbox. You would find out that they are out of the image. Clip them to the bound and your are good to go.

你好,因为我使用的是清洗后的公开数据集,按照方法转化为train_annotation和test_annotation后出现了大概一百多张左右的负坐标情况,我不清楚我对bbox的私人更改是否会影响到后续的评价指标,所以我按照上述对其越界进行了判断。

I don't see this as problem. Since bbox out of the image is not valid. The negative coordinate are obviously generated by some tools.

Notice that during the data augmentation, translation and cropping, we all have to clip the bbox to the bound. This is really easy, you can write a script loop through the dataset and clip them according to the

from yolov4-pytorch.

jingtianyilong avatar jingtianyilong commented on May 14, 2024

你好,我也遇到了这个问题,然后我在datasets.py进行了改动,对xind/yind的上下限进行了判断:
if int(xind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(xind) < 0: xind = 0 if int(yind) > int(train_output_size[i]-1): xind = (train_output_size[i]-1).astype(np.int32) if int(yind) < 0: yind = 0
但是训练出来效果很差,请问有朋友解决了吗?

Like I said. Check your bbox. You would find out that they are out of the image. Clip them to the bound and your are good to go.

你好,因为我使用的是清洗后的公开数据集,按照方法转化为train_annotation和test_annotation后出现了大概一百多张左右的负坐标情况,我不清楚我对bbox的私人更改是否会影响到后续的评价指标,所以我按照上述对其越界进行了判断。

I don't see this as problem. Since bbox out of the image is not valid. The negative coordinate are obviously generated by some tools.

Notice that during the data augmentation, translation and cropping, we all have to clip the bbox to the bound. This is really easy, you can write a script loop through the dataset and clip them according to the image size.

from yolov4-pytorch.

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.