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

Extracting predicted text from locally trained model #1

Closed
mustafakucuk0 opened this issue Oct 1, 2021 · 1 comment
Closed

Extracting predicted text from locally trained model #1

mustafakucuk0 opened this issue Oct 1, 2021 · 1 comment

Comments

@mustafakucuk0
Copy link

Hi! Thank you for this precious repo. I want to use this model in the one of my projects but I did not understand how you extract predicted text from images by using a locally trained model. I trained my model and it saved the 10 best models as ckpt files but as far as I understand you did not give any particular example about how to use a locally trained model. Am I going to use ckpt file as a model or save Trainer as the model pkl?

Thank you again for this repo.

@mustafakucuk0 mustafakucuk0 changed the title Extracting predicted text from trained model Extracting predicted text from locally trained model Oct 1, 2021
@reppertj
Copy link
Owner

reppertj commented Oct 2, 2021

Hey, looks like you might have figured it out, but for an example, check out this notebook. This could definitely be a bit friendlier-to-use for inference.

You'll have to create a datamodule, as in the notebook, then you can load the weights from the saved checkpoint: model = CaptioningRNN.load_from_checkpoint(checkpoint_path, datamodule=datamodule, batch_size=1)

Make sure you don't forget to call model.eval() to turn off batch norm & dropout & run the same preprocessing steps as in the notebook.

Feel free to ask if you have any questions!

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