-
Notifications
You must be signed in to change notification settings - Fork 1
Libtorch_install
moscowsky edited this page Jun 5, 2024
·
5 revisions
Libtorch is C++ API of torch machine learning library.
Download and unzip libtorch.
In CMakeLists.txt file of ExtendedObjectDetection project change line 12:
set(torch OFF)
to
set(torch ON)
And specify path to unzipped libtorch in line 43:
set(Torch_DIR "/home/${USER}/Lib/libtorch/share/cmake/Torch/")
Then rebuild project.
https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048
https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html
After you finished the above steps. The LibTorch has been installed on your device.
where is LibTorch installed?
Commonly, it installs at ~/.local/lib/python3.6/site-packages/torch/ In this dir, you can see bin, lib, and include dir, It is organized just like other C++ libraries. How to use LibTorch with CMake?
for example, add these two lines to your CMakeLists.txt
// set PyTorch path
set(Torch_DIR /home/nx/.local/lib/python3.6/site-packages/torch/share/cmake/Torch)
// use find_package to use libtorch
find_package(Torch REQUIRED)
- Home
- ROS-interface
- Interacting with a package through a configuration file
- Common structure of the configuration file
-
Simple objects
- Clusterization
- Filtering
- Tracking
- Attributes
- HSVcolor
- HistColor
- HaarCascade
- Size
- Hough
- Dimension
- BasicMotion
- Aruco
- Feature
- Pose
- DNN
- QR
- QR_Zbar
- LogicAnd
- LogicNot
- LogicOr
- Blob
- Depth
- RoughDist
- Dist
- FaceDlib
- ExractedInfoId
- ExractedInfoString
- UnitTranslation
- SquareObjectDistance
- TorchYOLOv7Attribute
- TorchYOLOv7KeypointAttribute
- ROSSubcriberOpenPoseRaw
- DummyHumanPose
- Complex objects
- Install Guides
- Usage Guides
- Troubleshooting