EasyOCR Assert错误:数据集不应为空的可迭代对象

5us2dqdw  于 2个月前  发布在  其他
关注(0)|答案(2)|浏览(40)

你好!
我正在使用教程中的"en_sample"模型进行训练。

  1. 我将"en_sample"分割成了"en_train_filtered"和"en_val"(两者都包含图像和.csv文件)在"all_data"中。
    P.S. 我还尝试只放置原始的"en_sample"文件夹,并尝试将第一个文件夹重命名为"en_filtered"
  2. 遵循了trainer.ipynb中的命令
  3. 遇到了问题:AssertionError: datasets should not be an empty iterable
    问题的截图:https://imgur.com/gf1uV9F
    希望尽快得到您的帮助:(

完整输出:

过滤包含不在opt.character中的字符的图像
过滤标签长度超过opt.batch_max_length的图像

dataset_root: all_data

opt.select_data: ['en_train_filtered']
opt.batch_ratio: ['1']

dataset_root: all_data dataset: en_train_filtered

AssertionError Traceback (most recent call last)
in <cell line: 2>()
1 opt = get_config("/content/EasyOCR/trainer/config_files/en_filtered_config.yaml")
----> 2 train(opt, amp=False)
3 frames
/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataset.py in init(self, datasets)
224 self.datasets = list(datasets)
225
--> 226 assert len(self.datasets) > 0, 'datasets should not be an empty iterable' # type: ignore[arg-type]
227 for d in self.datasets:
228 assert not isinstance(d, IterableDataset), "ConcatDataset does not support IterableDataset"
AssertionError: datasets should not be an empty iterable

ubbxdtey

ubbxdtey1#

你好!我正在使用教程中给出的"en_sample"模型进行训练。

1. I splitted "en_sample" into "en_train_filtered" and "en_val" (both contains images and .csv) in "all_data"
   P.S. I tried to place only raw "en_sample" folder and tried to rename the first folder to "en_filtered" also

2. Followed commands from trainer.ipynb

3. Got the issue: AssertionError: datasets should not be an empty iterable

问题截图: https://imgur.com/gf1uV9F
希望尽快得到帮助:(

完整输出:

过滤掉不包含opt.character中的字符的图像
过滤掉标签长度超过opt.batch_max_length的图像

dataset_root: all_data

opt.select_data: ['en_train_filtered']
opt.batch_ratio: ['1']

dataset_root: all_data dataset: en_train_filtered

Assert错误,回溯到以下代码行:2) opt = get_config("/content/EasyOCR/trainer/config_files/en_filtered_config.yaml") ----> 2 train(opt, amp=False)
3 frames /usr/local/lib/python3.10/dist-packages/torch/utils/data/dataset.py in init(self, datasets) 224 self.datasets = list(datasets) 225 --> 226 assert len(self.datasets) > 0, 'datasets should not be an empty iterable' # type: ignore[arg-type] 227 for d in self.datasets: 228 assert not isinstance(d, IterableDataset), "ConcatDataset does not support IterableDataset"
Assert错误:数据集不应为空的可迭代对象
文件夹名称应与config.yaml文件中的名称相对应。
这个特定的错误表明,根据您在config.yaml文件中定义的名称,无法找到数据。
最好将.yaml配置文件中的条目发布出来。

bsxbgnwa

bsxbgnwa2#

你解决了这个问题吗?我遇到了同样的问题,想知道一个好的"en_filtered_config.yaml"示例是什么样子的,以便参考。

相关问题