- 不能直接下载编译好的。使用起来会报错
- 要自己编译,详细根据自己的 JetPack 去下载对应版本
下载地址:JetPack libtorch下载地址
3.安装
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install Cython
sudo pip3 install torch-1.9.0-cp36-cp36m-linux_aarch64.whl
查看安装版本
pip3 list | grep torch
查看安装路径
pip show torch
/usr/local/lib/python3.8/dist-packages
- cmake 编译代码报错
cmake cannot find Torch
export Torch_DIR
as env variable before cmake
# 导入Torch库
#set(Torch_DIR $ENV{Torch_DIR})
set(CMAKE_PREFIX_PATH "/usr/local/lib/python3.8/dist-packages/torch")
find_package(Torch REQUIRED)
include_directories(${TORCH_INCLUDE_DIRS})
5./usr/bin/ld: warning: libopenblas.so.0
, needed by /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so, not found (try using -rpath or -rpath-link)
sudo apt-get install libopenblas-dev