使用ch_ptocr_v4__rec_server_infer.pth模型推理的时候报错,加载的模型结构和模型参数匹配不上。
完整的命令发下
是直接用predict_system.py跑的,在pytorchocr_utility.py中配置好了det和rec的pth文件路径。并且根据yaml文件配置了v4_server_infer的network_config见下图
可以对比下,跟命令行运行,配置差在哪里。初步看没看出有问题
可以对比下,跟命令行运行,配置差在哪里。初步看没看出有问题
我也遇到了这个问题,我运行的指令为
python -m tools.infer.predict_system --image_dir /home/ubuntu/shawn/test_imgs/sda.jpg --det_model_path /home/ubuntu/shawn/paadletorch/PaddleOCR2Pytorch/ch_ptocr_v4_det_infer.pth --det_yaml_path ./configs/det/ch_PP-OCRv4/ch_PP-OCRv4_det_teacher.yml --rec_image_shape 3,48,320 --rec_model_path /home/ubuntu/shawn/paadletorch/PaddleOCR2Pytorch/ch_ptocr_v4_rec_server_infer.pth --rec_yaml_path ./configs/rec/PP-OCRv4/ch_PP-OCRv4_rec.yml
请问哪里有问题吗
@CeasarQ
I think a different config file makes sense.
DET server model -> ./configs/det/ch_PP-OCRv4_det_teacher.yml REC server model -> ./configs/rec/ch_PP-OCRv4_rec_hgnet.yml