Closed madinwei closed 1 year ago
cmakelists Set onnxruntime ROOT_PATH and try again. I am not good at deploying it on Linux. If this doesn't work, add the onnxruntime link library to the system environment variable like configuring the cuda.
太感谢了 @UNeedCryDear , I just set my path and compile and it worked fine. with that, I will close this issue. However, I have a couple of questions about this issue.
- 编译后只生产 yolov8,我需要 yolov8-seg 有没有办法编译它?
- 有没有办法在不需要编译的情况下使用C++代码?因为你不擅长 ^_^
项目名字叫yolov8,实际上包括了yolov8和yolov8-seg,这两者又分别包括了opencv和onnxruntime两个版本。你可以通过修改这里的链接只编译其中一种组合(例如yolov8+onnxruntime),然后修改mian.cpp中的调用为yolov8+onnxruntime的调用,最后重新编译。
@UNeedCryDear , thank you for your help and response.
I hope I didn't bother you, but I have another problem. even though my build is successful the yolov8 is not implementing:
~/yolov8-opencv-onnxruntime-cpp/build$ ./YOLOv8
************* Infer model on CPU! *************
read net ok!
Segmentation fault (core dumped)
as you see after I call YOLOv8 no detection happened, I checked my compiling but there was no error :
~/yolov8-opencv-onnxruntime-cpp/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mad/yolov8-opencv-onnxruntime-cpp/build
~/yolov8-opencv-onnxruntime-cpp/build$ make
Consolidate compiler generated dependencies of target YOLOv8
[ 14%] Building CXX object CMakeFiles/YOLOv8.dir/main.cpp.o
[ 28%] Linking CXX executable YOLOv8
[100%] Built target YOLOv8
I also make sure my path to my models and test image is right, so I have no clue what's going on , if you have any helpful tips I will appreciate it
I have solved it by modifying _className to my number of class
@UNeedCryDear , thank you for your help and response.
I hope I didn't bother you, but I have another problem. even though my build is successful the yolov8 is not implementing:
~/yolov8-opencv-onnxruntime-cpp/build$ ./YOLOv8 ************* Infer model on CPU! ************* read net ok! Segmentation fault (core dumped)
as you see after I call YOLOv8 no detection happened, I checked my compiling but there was no error :
~/yolov8-opencv-onnxruntime-cpp/build$ cmake .. -- Configuring done -- Generating done -- Build files have been written to: /home/mad/yolov8-opencv-onnxruntime-cpp/build ~/yolov8-opencv-onnxruntime-cpp/build$ make Consolidate compiler generated dependencies of target YOLOv8 [ 14%] Building CXX object CMakeFiles/YOLOv8.dir/main.cpp.o [ 28%] Linking CXX executable YOLOv8 [100%] Built target YOLOv8
I also make sure my path to my models and test image is right, so I have no clue what's going on , if you have any helpful tips I will appreciate it
Hello 你好@UNeedCryDear ,
thank you for this amazing repository. While I was compiling I encountered the following ERROR:
To my knowledge, the error means that the Onnx lib is not installed, however, I have already installed it by downloading onnxruntime-linux-x64-gpu-1.9.0.tgz and unzip it in the /usr/local folder.
I am still novice, so any help or advice will be valuable for me. looking forward to your response