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

Convert pretrained .torch model (including weights) #34

Open
CarlosNacher opened this issue Apr 19, 2024 · 4 comments
Open

Convert pretrained .torch model (including weights) #34

CarlosNacher opened this issue Apr 19, 2024 · 4 comments

Comments

@CarlosNacher
Copy link

Hi, I am new to your library and would quickly like to know if I could convert a pre-trained torch model to keras. I mean, from what I see in the README, what is converted is the model code, but if we have the weights in the .torch model, how do we put them to the new keras model?

Maybe this question is very obvious, but I don't see the direct way to do it.

Thanks in advance

@AlexanderLutsenko
Copy link
Owner

Hi! To trace a model, we need to perform inference on it. Do you have the inference script?

@CarlosNacher
Copy link
Author

Hi! What do you exactly mean? I have my model.pt (trained) and also, yes, I have some script that loads the torch model, the data, preprocesses data, does inference, etc. But why is the inference script needed to transfer the weights from one (torch) model to another (tf) one?

Thank you for your response!

@happyTonakai
Copy link

I think nobuco converts a torch model to a keras model without losing the parameters. You can try to figure out the outputs with a same input.

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

4 participants