DBNet.pytorch icon indicating copy to clipboard operation
DBNet.pytorch copied to clipboard

IndexError

Open wwp-max opened this issue 3 years ago • 4 comments

Traceback (most recent call last): File "C:/Users/Lenovo/DBNet.pytorch/tools/train.py", line 79, in main(config) File "C:/Users/Lenovo/DBNet.pytorch/tools/train.py", line 41, in main validate_loader = get_dataloader(config['dataset']['validate'], False) File "C:\Users\Lenovo\DBNet.pytorch\data_loader_init_.py", line 84, in get_dataloader dataset = get_dataset(data_path=data_path, module_name=dataset_name, transform=img_transfroms, dataset_args=dataset_args) File "C:\Users\Lenovo\DBNet.pytorch\data_loader_init.py", line 23, in get_dataset s_dataset = getattr(dataset, module_name)(transform=transform, data_path=data_path, File "C:\Users\Lenovo\DBNet.pytorch\data_loader\dataset.py", line 17, in init super().init(data_path, img_mode, pre_processes, filter_keys, ignore_tags, transform) File "C:\Users\Lenovo\DBNet.pytorch\base\base_dataset.py", line 18, in init assert item in self.data_list[0], 'data_list from load_data must contains {}'.format(item_keys) IndexError: list index out of range

配置文件修改成功后,运行train.py就报了这个错误,请问有人知道是什么原因吗?

wwp-max avatar Mar 23 '22 07:03 wwp-max

数据格式不对

ming-eng avatar Mar 26 '22 08:03 ming-eng

不是数据格式不对,是你的util里面的get_datalist写错了:line = line.strip('\n').replace('.jpg ', '.jpg\t').split('\t') 。train.txt 的格式是img \t gt 的话replace之后就有两个\t。作者改一下源码把replace去掉或者把train.txt 的格式改一下

KKjiaming avatar Jun 15 '22 14:06 KKjiaming

@KKjiaming 改完还是不太对

Wangqi12138 avatar Nov 24 '23 03:11 Wangqi12138

debug看看哦,很简单的

WenmuZhou avatar Nov 24 '23 07:11 WenmuZhou