Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
melodylzl opened this issue Oct 23, 2024 · 4 comments
Open

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

melodylzl opened this issue Oct 23, 2024 · 4 comments

Comments

@melodylzl
Copy link

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

@frotms
Copy link
Owner

frotms commented Oct 23, 2024

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

@melodylzl
Copy link
Author

大佬您好,是这样导出的
在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请教下吗

@frotms
Copy link
Owner

frotms commented Oct 23, 2024

42894130

@frotms
Copy link
Owner

frotms commented Oct 23, 2024

可以先对齐pt的精度

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants