PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.1k stars 7.81k forks source link

AssertionError: The ./pretrain_models/MobileNetV3_large_x0_5_pretrained.pdparams does not exists while custom training of detection model #7312

Closed minhson1411 closed 1 year ago

minhson1411 commented 2 years ago

Team, please help to fix the issue below...I am getting when running the custom detection training:

[2022/08/10 21:34:29] ppocr INFO: train with paddle 2.3.1 and device Place(cpu) [2022/08/10 21:34:29] ppocr INFO: Initialize indexs of datasets:['C:/Users/Anirban/Desktop/PaddleOCR-release-2.5/train_data/train_txt/Label.txt'] [2022/08/10 21:34:30] ppocr INFO: Initialize indexs of datasets:['C:/Users/Anirban/Desktop/PaddleOCR-release-2.5/train_data/train_txt/Label.txt'] Traceback (most recent call last): File "tools/train.py", line 191, in main(config, device, logger, vdl_writer) File "tools/train.py", line 140, in main pre_best_model_dict = load_model(config, model, optimizer, File "C:\Users\Anirban\Desktop\PaddleOCR-release-2.5\ppocr\utils\save_load.py", line 86, in load_model assert os.path.exists(checkpoints + ".pdparams"), AssertionError: The ./pretrain_models/MobileNetV3_large_x0_5_pretrained.pdparams does not exists!

tink2123 commented 2 years ago

You need to download the pretrained_model first , can refer to doc

cd PaddleOCR/
# Download the pre-trained model of MobileNetV3
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams
# or, download the pre-trained model of ResNet18_vd
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams
# or, download the pre-trained model of ResNet50_vd
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet50_vd_ssld_pretrained.pdparams