본문 바로가기

error모음

[jetson mmdetection] error

728x90
반응형

#error 1

error while loading shared libraries: libopenblas.so.0: cannot open shared object

sol : sudo apt-get install libopenblas-dev

 

#pytorch 1.14 ( jetpack 5.1.2 )

whl download 

https://developer.download.nvidia.com/compute/redist/jp/v51/pytorch/

더 낮은 버전

https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048

 

#onnxruntime-gpu for jetson ( onnxruntime-gpu 1.15.1 )

https://elinux.org/Jetson_Zoo#ONNX_Runtime

 

# error 2 : version `GLIBCXX_3.4.29' not found

 

sol

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6

 

# cmake version upgrade

# purge existing
sudo apt-get purge cmake -y

# install prebuilt binary
export CMAKE_VER=3.23.1
export ARCH=aarch64
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-linux-${ARCH}.sh
chmod +x cmake-${CMAKE_VER}-linux-${ARCH}.sh
sudo ./cmake-${CMAKE_VER}-linux-${ARCH}.sh --prefix=/usr --skip-license
cmake --version

 

# mmdeploy build 명령어

cmake .. DMMDEPLOY_TARGET_DEVICES='cuda;cpu' -DMMDEPLOY_TARGET_BACKENDS="trt;ort" DONNXRUNTIME_DIR=${ONNXRUNTIME_DIR} -DMMDEPLOY_BUILD_SDK=ON -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON -DMMDEPLOY_BUILD_EXAMPLES=ON -DMMDEPLOY_CODEBASES=all -Dpplcv_DIR=${PPLCV_DIR}/cuda-build/install/lib/cmake/ppl

 

# build 시 onnxruntime_dir 관련 에러가 날때

https://github.com/microsoft/onnxruntime/releases/tag/v1.17.0

 

Release ONNX Runtime v1.17.0 · microsoft/onnxruntime

Announcements In the next release, we will totally drop support for Windows ARM32. General Added support for new ONNX 1.15 opsets: IsInf-20, IsNaN-20, DFT-20, ReduceMax-20, ReduceMin-20, AffineGri...

github.com

1. 여기서 tar 파일 받음 ( 1.15.1 으로 했음 ) -> 1.16 이상부터는 api가 바뀌어서 build가 되지 않음

2.

cd tar파일 해제 경로
export ONNXRUNTIME_DIR=$(pwd)
export LD_LIBRARY_PATH=$ONNXRUNTIME_DIR/lib:$LD_LIBRARY_PATH

 

# onnx custom op

path = "./site-packages/mmdeploy/lib/libmmdeploy_onnxruntime_ops.so"
model_path = "end2end-mask2former.onnx"
session_options = ort.SessionOptions()
session_options.register_custom_ops_library(path)
ort_session = ort.InferenceSession(model_path,session_options)`

728x90
반응형