PaddleOCR2Pytorch icon indicating copy to clipboard operation
PaddleOCR2Pytorch copied to clipboard

请问下如何把ch_ptocr_v4_rec_infer.pth转成pt文件?

Open melody-void opened this issue 1 year ago • 4 comments

我这边尝试在predict_rec.py加载模型后用torch.jit.trace导出pt后,发现无法用

melody-void avatar Oct 23 '24 03:10 melody-void

无法用是什么意思呢?是怎么导出的,导出之后做了什么操作?

frotms avatar Oct 23 '24 10:10 frotms

大佬您好,是这样导出的 在predict_rec.py中加了这些操作: example = torch.rand(1, 3, 48, 320) traced_script_module = torch.jit.trace(self.net, example) traced_script_module.save("model_pnnx.py.pt")

导出之后: 拿到pt文件继续用pnnx转换ncnn后,识别的精度效果不太好(对比了其他人转换的模型)

方便的话,可以加个QQ请教下吗

melody-void avatar Oct 23 '24 12:10 melody-void

42894130

frotms avatar Oct 23 '24 12:10 frotms

可以先对齐pt的精度

frotms avatar Oct 23 '24 12:10 frotms