Layout-Parser / layout-model-training

The scripts for training Detectron2-based Layout Models on popular layout analysis datasets
202 stars 55 forks source link

TypeError: object of type 'int' has no len() #13

Open gamingflexer opened 1 year ago

gamingflexer commented 1 year ago
Traceback (most recent call last):
  File "/content/layout-model-training/tools/train_net.py", line 228, in <module>
    args=(args,),
  File "/content/detectron2/detectron2/engine/launch.py", line 82, in launch
    main_func(*args)
  File "/content/layout-model-training/tools/train_net.py", line 181, in main
    trainer = Trainer(cfg)
  File "/content/detectron2/detectron2/engine/defaults.py", line 378, in __init__
    data_loader = self.build_train_loader(cfg)
  File "/content/layout-model-training/tools/train_net.py", line 75, in build_train_loader
    return build_detection_train_loader(cfg, mapper=mapper)
  File "/content/detectron2/detectron2/config/config.py", line 207, in wrapped
    explicit_args = _get_args_from_config(from_config, *args, **kwargs)
  File "/content/detectron2/detectron2/config/config.py", line 245, in _get_args_from_config
    ret = from_config_func(*args, **kwargs)
  File "/content/detectron2/detectron2/data/build.py", line 350, in _train_loader_from_config
    proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None,
  File "/content/detectron2/detectron2/data/build.py", line 274, in get_detection_dataset_dicts
    print_instances_class_histogram(dataset_dicts, class_names)
  File "/content/detectron2/detectron2/data/build.py", line 194, in print_instances_class_histogram
    itertools.chain(*[[short_name(class_names[i]), int(v)] for i, v in enumerate(histogram)])
  File "/content/detectron2/detectron2/data/build.py", line 194, in <listcomp>
    itertools.chain(*[[short_name(class_names[i]), int(v)] for i, v in enumerate(histogram)])
  File "/content/detectron2/detectron2/data/build.py", line 189, in short_name
    if len(x) > 13:
TypeError: object of type 'int' has no len()

Annotations files are correct i could not figure whats going wrong? my classes are numbers - [1,2,3..9]

but could not figure out how to solve it. @XBeg9 @lolipopshock.