ksasso1028 / EasyOCR-cpp

Custom C++ implementation of deep learning based OCR
41 stars 8 forks source link

How to convert pytorch model to Torch script? #11

Open DaveNM2021 opened 2 months ago

DaveNM2021 commented 2 months ago

Hello, How are you? How to convert pytorch model to Torch script? Thanks. Dave.

ksasso1028 commented 2 months ago

hello Dave!

Here is the tutorial on how to move to TorchScript https://pytorch.org/tutorials/beginner/Intro_to_TorchScript_tutorial.html

In short, you must choose between tracing or scripting which the tutorial goes rather in depth on. In this case, I had to trace the models.

DaveNM2021 commented 2 months ago

Thank you very much. I have tried tracing. but I can not use it in libtorch. Could you write the script to trace pytorch model? Best Regards.