AssertionError: The length of ratio_list should be the same as the file_list

         Recently, I want to use Baidu's PaddleOCR for license recognition, and I want to improve the point recognition rate by training some of my own data sets. But the model kept reporting errors during training, and this one error tormented me, a rookie, all afternoon~~>_<~~! , so write a post to record it!

Always report an error:

Traceback (most recent call last):
File ".\tools\train.py", line 148, in
main(config, device, logger, vdl_writer)
File ".\tools\train.py", line 52, in main
train_dataloader = build_dataloader(config, 'Train', device, logger)
File "D:\PaddleOCR-release-2.4\ppocr\data_init_.py", line 64, in build_dataloader
dataset = eval(module_name)(config, mode, logger, seed)
File "D:\PaddleOCR-release-2.4\ppocr\data\simple_dataset.py", line 41, in init
) == data_source_num, "The length of ratio_list should be the same as the file_list."
AssertionError: The length of ratio_list should be the same as the file_list.

        After a search, it was found that the address of data_dir and label_file_list in the .yml configuration file used by the model under the configs folder was not written correctly, and the address here corresponds to the path of its own dataset.

 My dataset location and directory structure

Both original pictures and txt files are placed directly under the img-licence folder.

solution

 It is recommended that if you encounter problems, go to the github official website to search directly, it can really save a lot of time, a bloody lesson! ! !

 

 

 

 

Guess you like

Origin blog.csdn.net/JulyLH/article/details/125932993