Loading ExtraFilesMap in Java?
See original GitHub issueQuestion
When saving a trained model using Pytorch, extra information can be added in Python or C++ using an ExtraFilesMap object. In Python this extra metadata can be extracted from a saved model e.g. via
# load the jit model and associated settings.
extra_files = torch._C.ExtraFilesMap()
extra_files['dataOpts'] = ''
model = torch.jit.load(filepath_model, _extra_files=extra_files)
Using djl, a trained model can be loaded in Java, however, however, there does not appear to be any method to extract the ExtraFileMap information? I’ve spent some time trying to find a solution with no luck. Am I missing something - is this possible using djl?
If not, can we bump this to a feature request. It’s very useful having metadata such as this stored with the model.
Thanks for any help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Loading ExtraFilesMap in Java? · Issue #312 - GitHub
Question When saving a trained model using Pytorch, extra information can be added in Python or C++ using an ExtraFilesMap object.
Read more >How should I load files into my Java application?
The short answer. Use one of these two methods: Class.getResource(String) · Class.getResourceAsStream(String). For example:
Read more >How to Save/Load Data with Text File (1/2) - Java Extra 15
Previous: https://youtu.be/-BBC_tJkD_ENext: https://youtu.be/6y6aWvi-OvMOn this video, I'll explain how to save/ load your game by using a ...
Read more >Different ways of Reading a text file in Java - GeeksforGeeks
Methods: Using BufferedReader class; Using Scanner class; Using File Reader class; Reading the whole file in a List; Read a text file as...
Read more >How the JVM Locates, Loads, and Runs Libraries - Oracle Blogs
In this article, I explain the Java class-loading mechanism in detail and how it works. I also explain how classes are found in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@macster110, please feel free to raise a PR to fix it 😃
Ok, I optimized our import procedure. You will be able to fetch these information through:
I tested with the model you have provided and it is working now. You can get the SNAPSHOT version and use it today. We have nightly snapshot published to maven everyday.