Git Product home page Git Product logo

torchscript's Introduction

torchscript

To run the Python programs, it should suffice to install the Python distribution of PyTorch from pytorch.org. Choose, for example, the stable build, your operating system, Conda or Pip, Python, and CPU. It appears that setting the LD_LIBRARY_PATH as described in the next paragraph will interfere with Python operations, so avoid it or turn it off for the Python programs.

To run the Java or Scala programs, you need to have the libraries installed and accessible. At pytorch.org choose, for example, the stable build, your operating system, LibTorch, C++/Java, and CPU. Download the packange and unzip the file on your hard drive.

  • Linux

    Make sure the LD_LIBRARY_PATH environment variable includes the the lib directory of the unzipped package, such as /home/you/libtorch/lib. The operating system will use this to load *.so files and Java borrows it to set the value of java.library.path.

    $ export LD_LIBRARY_PATH=/home/you/libtorch/lib`
  • Windows

    Make sure the PATH environment variable includes the lib directory of the unzipped package, such as D:\Users\you\libtorch\lib. The operating system will use this to load *.dll files and Java borrows it to set the value of java.library.path.

    For the regular command prompt it might look like

    > set PATH=D:\Users\you\libtorch\lib;%PATH%

    and for PowerShell like this:

    PS> $env:PATH="D:\Users\you\libtorch\lib;" + $env:PATH
  • Mac

    This is problematic. Java apparently and maybe officially does not have access to the LD_LIBRARY_PATH or DYLD_LIBRARY_PATH variables and cannot use them to build java.library.path or use them in sbt so that a torchscript program will run from there. The operating system uses the variables to find the *.dylib files and Java borrows them to set the value of java.library.path. So far the only way the example program has worked is by being called directly from Java after sbt dist with all the aforementioned variables having been set manually.

    $ export LD_LIBRARY_PATH=/home/you/libtorch/lib
    $ export DYLD_LIBRARY_PATH=/home/you/libtorch/lib
    $ java -Djava.library.path=/home/you/libtorch/lib ...

torchscript's People

Contributors

kwalcock avatar

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.