Fine-tuned Model not working, model mismatch error #15779
Replies: 2 comments
-
Hello, PP-OCRv5_server_rec is the default model for paddleocr 3.0. If you want to specify a different model, you need to set the text_recognition_model_name. The example code is as follows: ocr = PaddleOCR(
lang='en',
use_doc_orientation_classify=False,
use_textline_orientation=False,
device="gpu",
text_detection_model_name="PP-OCRv4_mobile_det",
text_recognition_model_name="en_PP-OCRv4_mobile_rec",
text_recognition_model_dir = '/home/paddle_OCR/inference/en_PP-OCRv4_mobile_rec_infer'
).. |
Beta Was this translation helpful? Give feedback.
-
thanks, also Is there any way to turn off detection like previous versions? also the finetuned model is performing worse than the pretrained model? any specific reason / method is hould follow ? . because i was getting validation accuracy of 92% when training. this is the en-ppocrv4_mobile_rec.yml i used for training : Global:
The training procedure I followed: Created text file with the image path and word using gen_label.py |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Created a fine-tuned model using PaddlePaddle 3.0.0 GPU and PaddleOCR 3.0.1 with en_PPOCRv4_mobile_rec. and after that exported the model adn when trying to infer the model with :
from paddleocr import PaddleOCR
import os
import re
Input and Output folders
images_folder = "./images"
output_folder = "./test_out"
os.makedirs(output_folder, exist_ok=True)
Initialize PaddleOCR
ocr = PaddleOCR(
lang='en',
use_doc_orientation_classify=False,
use_textline_orientation=False,
device="gpu",
text_detection_model_name="PP-OCRv4_mobile_det",
text_recognition_model_dir = '/home/paddle_OCR/inference/en_PP-OCRv4_mobile_rec_infer'
)......
...
...
the error says :
UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
warnings.warn(warning_message)
Creating model: ('UVDoc', None)
Using official model (UVDoc), the model files will be automatically downloaded and saved in /home/trois/.paddlex/official_models.
Fetching 6 files: 100%|█████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 47482.69it/s]
Creating model: ('PP-OCRv4_mobile_det', None)
Using official model (PP-OCRv4_mobile_det), the model files will be automatically downloaded and saved in /home/.paddlex/official_models.
Fetching 6 files: 100%|██████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 7478.70it/s]
Creating model: ('PP-OCRv5_server_rec', '/home/paddle_OCR/inference/en_PP-OCRv4_mobile_rec_infer')
Traceback (most recent call last):
Even though I trained on OCR4_mobile_rec, it’s creating PP-OCRv5_server_rec.
And also, finally with this error:
model_name == config["Global"]["model_name"]
AssertionError: Model name mismatch, please input the correct model dir.
Can someone provide the script for infer?
Beta Was this translation helpful? Give feedback.
All reactions