Coder Social home page Coder Social logo

How to run the code about pytorch-cpp HOT 8 CLOSED

prabhuomkar avatar prabhuomkar commented on May 12, 2024
How to run the code

from pytorch-cpp.

Comments (8)

mfl28 avatar mfl28 commented on May 12, 2024 1

If you followed the steps in "Getting Started" in the readme, the binaries should be in

build/tutorials/<tutorial_category>/<tutorial_name>/

So for example, the executable for the logistic regression tutorial should be in

build/tutorials/basics/logistic_regression/

from pytorch-cpp.

mfl28 avatar mfl28 commented on May 12, 2024 1

Thanks!

cmake -build build

You need to use two hyphens before the build parameter, like this:
cmake --build build

Some additional info for the first cmake command (cmake -B build ...):

  • It isn't necessary to specify -D CUDA_V=none as it is set by default.
  • You don't have to set -D DOWNLOAD_DATASETS=OFF if the data was already previously downloaded as the cmake script checks if files are already present (in pytorch-cpp/data) and if so, doesn't redownload them. If, on the other hand, you really don't want to download the datasets at all through the cmake script, you'll have to do it manually, otherwise most of the tutorials won't run.
  • Also you don't need to specify -D CMAKE_PREFIX_PATH=./, as by default the cmake script will look for a previously downloaded libtorch in pytorch-cpp/libtorch if CMAKE_PREFIX_PATH is not specified.

So, in short, if you want to build on Linux, using libtorch for CPU (and not using an existing local version outside of pytorch-cpp/libtorch) it should be enough to do:

cmake -B build
cmake --build build

@prabhuomkar We might want to clarify some of these things better in the readme.

from pytorch-cpp.

abhigoku10 avatar abhigoku10 commented on May 12, 2024

@mfl28 @prabhuomkar i followed the same steps but not able to see any binary files
image
in the mentioned location i have only the above contents . i am performing this activity on cpu , i have disable cuda==None

from pytorch-cpp.

mfl28 avatar mfl28 commented on May 12, 2024

Can you tell me exactly the cmake commands you used?
Did you execute cmake --build build from the pytorch-cpp directory after generating the build system?

from pytorch-cpp.

abhigoku10 avatar abhigoku10 commented on May 12, 2024

@mfl28 Thanks for instant response .Please find the commands i have done
git clone https://github.com/prabhuomkar/pytorch-cpp.git
cd pytorch-cpp
cmake -B build -D CUDA_V=none -D DOWNLOAD_DATASETS=OFF -D CMAKE_PREFIX_PATH= ./
cmake -build build

from pytorch-cpp.

abhigoku10 avatar abhigoku10 commented on May 12, 2024

@mfl28 thanks for the steps now i am able to build the binaries

from pytorch-cpp.

prabhuomkar avatar prabhuomkar commented on May 12, 2024

We might want to clarify some of these things better in the readme.

@mfl28 Agreed, I will send a PR for this.

from pytorch-cpp.

prabhuomkar avatar prabhuomkar commented on May 12, 2024

@abhigoku10 let's close this if there are not more queries or issues in running the code?

from pytorch-cpp.

Related Issues (20)

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.