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 extra-file information. Where is the ExtraFilesMap()? #4

Open
macster110 opened this issue Sep 22, 2020 · 0 comments
Open

Comments

@macster110
Copy link

macster110 commented Sep 22, 2020

This is a fantastic library - I've been testing it out and great to have native java implementation which works with existing software. However I've come across an issue I can't seem to resolve. I am unable to extract any of the metadata associated with a pre-trained model?

When saving a trained model, extra information can be added in Python or C++ using an ExtraFilesMap object. In this case the extra info is the type of audio data the model was trained on; this is vital for pre-conditioning audio data before it's passed to a model for classification. In Python this extra metadata can be extracted from a saved model via...

extra_files = torch._C.ExtraFilesMap()
model = torch.jit.load(filepath_model, _extra_files=extra_files)
dataOptsStr = extra_files['dataOpts']

In Java a trained model can be loaded using...

Module mod = Module.load(modelPath);

However, there does not appear to be any method to extract the ExtraFileMap information. I've spent a long time trying to find a solution with no luck. Am missing something here? It seems like important functionality for sharing models between different languages etc.?

Thanks for the help.

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

1 participant