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

how to convert to torchscript using script method. using trace method cause the model cannot handle the dynamic input. #146

Open
AnanasPizzaMigliore opened this issue Aug 8, 2024 · 1 comment

Comments

@AnanasPizzaMigliore
Copy link

No description provided.

@Dordor333
Copy link

Dordor333 commented Aug 20, 2024

I encountered an issue when trying to convert my model to TorchScript using:
torch_jit = model.to_torchscript(file_path='torchscript_model_new_1_epoch.pt', method='trace', example_inputs=dummy_input)

ocr_model_load = torch.jit.load('torchscript_model_new_1_epoch.pt').eval()
Specifically, the output from the traced model does not match the output from the original model. Additionally, the model loaded from TorchScript seems to have some irrelevant characters added to the output, which further complicates the results.

Could you please help me understand why this might be happening and how to resolve it?

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