用YOLOX训练自己的数据集报错

yolox训练自己的模型出问题

 | ERROR       if self.cache and self.cache_type == "ram":
AttributeError: 'VOCDetection' object has no attribute 'cache'
 | yolox.core.launch:98 - An error has been caught in function 'launch', process 'MainProcess' (5980), thread 'MainThread' (15840):
Traceback (most recent call last):

  File "C:\Users\23539\YOLOX-main\tools\train.py", line 137, in 
    launch(
    └ <function launch at 0x0000028CA2EDBE50>

> File "c:\users\23539\yolox-main\yolox\core\launch.py", line 98, in launch
    main_func(*args)
    │          └ (╒═══════════════════╤═══════════════════════════════════════════════════════════════════════════════════════════════════════...
    └ <function main at 0x0000028CA0EEB700>

  File "C:\Users\23539\YOLOX-main\tools\train.py", line 118, in main
    trainer.train()
    │       └ <function Trainer.train at 0x0000028CA44C4790>
    └ 0x0000028CA44D12E0>

  File "c:\users\23539\yolox-main\yolox\core\trainer.py", line 75, in train
    self.before_train()
    │    └ <function Trainer.before_train at 0x0000028CA44CB160>
    └ 0x0000028CA44D12E0>

  File "c:\users\23539\yolox-main\yolox\core\trainer.py", line 150, in before_train
    self.train_loader = self.exp.get_data_loader(
    │                   │    │   └ <function Exp.get_data_loader at 0x0000028CA44C49D0>
    │                   │    └ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
    │                   └ 0x0000028CA44D12E0>
    └ 0x0000028CA44D12E0>

  File "c:\users\23539\yolox-main\yolox\exp\yolox_base.py", line 180, in get_data_loader
    self.dataset = self.get_dataset(cache=False, cache_type=cache_img)
    │    │         │    │                                   └ None
    │    │         │    └ <function Exp.get_dataset at 0x0000028CA44CBD30>
    │    │         └ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...
    │    └ None
    └ ╒═══════════════════╤════════════════════════════════════════════════════════════════════════════════════════════════════════...

  File "C:\Users\23539\YOLOX-main\exps/example/yolox_voc\yolox_voc_s.py", line 27, in get_dataset
    return VOCDetection(
           └ 'yolox.data.datasets.voc.VOCDetection'>

  File "c:\users\23539\yolox-main\yolox\data\datasets\voc.py", line 137, in __init__
    path_filename = [

  File "c:\users\23539\yolox-main\yolox\data\datasets\voc.py", line 138, in 
    (self._imgpath % self.ids[i]).split(self.root + "/")[1]
     │    │          │    │   │         │    └ 'C:/Users/23539/YOLOX-main/datasets/VOCdevkit'
     │    │          │    │   │         └ 0x0000028CAE6AFDF0>
     │    │          │    │   └ 0
     │    │          │    └ [('C:/Users/23539/YOLOX-main/datasets/VOCdevkit\\VOC2007', '0000002_00005_d_0000014'), ('C:/Users/23539/YOLOX-main/datasets/V...
     │    │          └ 0x0000028CAE6AFDF0>
     │    └ '%s\\JPEGImages\\%s.jpg'
     └ 0x0000028CAE6AFDF0>

IndexError: list index out of range

你看下和它原本的数据集格式是否有不同,现在是索引超出范围,所以干脆做成和它一样的数据集格式

请问博主解决了吗,我也遇到同样的问题。

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^

博主这个问题解决了吗?我也遇到了

这个问题解决了吗