dreiss / java-demo Goto Github PK
View Code? Open in Web Editor NEWPyTorch Java demo
PyTorch Java demo
The demo you provide is very efficient, and I have traced my model to inference with JAVA, my question is whether I could use CUDA to inference the model, since the java method of libtorch is far less than C++, and I didn't find the to(kCUDA)
on https://pytorch.org/javadoc/.
Looking forward to your reply.
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.
Hope as soon as possible...
Firstly, thank you for building such a great tool.
But how can I build a version which using cpu only because file libtorch_cuda.so is too big.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.