Skip to content

Commit

Permalink
Add missing model tracing step to cpp example readme, fixes #7952 (#7963
Browse files Browse the repository at this point in the history
)

Co-authored-by: Philip Meier <github.pmeier@posteo.de>
  • Loading branch information
abstractionmage and pmeier authored Sep 18, 2023
1 parent b6574c9 commit d7c20dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/cpp/hello_world/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Once both dependencies are sorted, we can start the CMake fun:

1) Create a ``build`` directory inside the current one.
2) from within the ``build`` directory, run the following commands:
- ``python ../trace_model.py`` To use a torchvision model in C++, you must first export it from the python version of torchvision. More information can be found on the corresponding `documentation page <https://pytorch.org/tutorials/advanced/cpp_export.html#loading-a-torchscript-model-in-c>`_.
- | ``cmake -DCMAKE_PREFIX_PATH="<PATH_TO_LIBTORCH>;<PATH_TO_TORCHVISION>" ..``
| where ``<PATH_TO_LIBTORCH>`` and ``<PATH_TO_TORCHVISION>`` are the paths to the libtorch and torchvision installations.
- ``cmake --build .``
Expand Down

0 comments on commit d7c20dd

Please sign in to comment.