Giter Site home page Giter Site logo

java-demo's People

Contributors

dreiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

java-demo's Issues

Does libtorch-java support CUDA?

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.

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

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.

java-cpu-only

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.