Skip to content

Extracting extra-file information. Where is the ExtraFilesMap()? #4

@macster110

Description

@macster110

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions