Closed Flamse closed 1 week ago
需要在可执行文件目录下,export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
重新编译一下库,编译案例的时候输出ite.ai.toolkit_LIBS_DIRS:
cmake_minimum_required(VERSION 3.10)
project(lite_yolov5)
set(CMAKE_CXX_STANDARD 17)
set(lite.ai.toolkit_DIR YOUR-PATH-TO/lite.ai.toolkit/build/install)
find_package(lite.ai.toolkit REQUIRED PATHS ${lite.ai.toolkit_DIR})
if (lite.ai.toolkit_Found)
message(STATUS "lite.ai.toolkit_INCLUDE_DIRS: ${lite.ai.toolkit_INCLUDE_DIRS}")
message(STATUS " lite.ai.toolkit_LIBS: ${lite.ai.toolkit_LIBS}")
message(STATUS " lite.ai.toolkit_LIBS_DIRS: ${lite.ai.toolkit_LIBS_DIRS}")
endif()
add_executable(lite_yolov5 test_lite_yolov5.cpp)
target_link_libraries(lite_yolov5 ${lite.ai.toolkit_LIBS})
然后把相关的路径export一下即可
感谢,模型已经成功加载并计算完成。提几个点:
std::string onnx_path = "../../../../examples/hub/onnx/cv/yolov5s.onnx";
// ...
terminate called after throwing an instance of 'Ort::Exception'
what(): Unexpected input data type. Actual: (tensor(float)) , expected: (tensor(float16))
GPU后续版本会继续支持。也可以通过修改依赖库和lite.ai.toolkit的源码加支持,很好改。
依照项目部署命令
和output check代码
把
OpenCV
和onnxruntime
所有相关的.so
文件复制到.exe
相同路径下,但是报错:会是我的c++编译器和cmake版本问题导致的吗?这两个软件都是通过
apt
直接安装的。