installing 3.4.12 for ubuntu 18.04 LTS (install from source) for yolov4
Hi, i have decided to change to opencv 3.4.12 , the latest version for the 3.4.x series. Now, i understand that the command
git clone https://github.com/opencv/opencv.git
can be used to install the latest version, however, it only does this for the latest overall version, which is 4.5.1 .
What can i do to specify to the terminal that i want to install 3.4.12 . Please give some suggestions, thank you.
Prefarably, on how to install opencv from source.
The website i found to install opencv for ubuntu 18.04: https://linuxize.com/post/how-to-inst...
What cmake configuration options did you use? Did you try compiling it without OpenCL support?
please also try with a more recent version, 3.4.0 is years old, and noone can reproduce your problems anymore
Before u installed opencv3.4.0. Didn't u update and upgrade before ?
i did update and upgrade
R u on raspberry pi? What's model?
How do i check my cmake configuration options, I basically just accessed a directory, then "make -j4". I followed this website: https://www.pytorials.com/how-to-inst...
Except for
sudo apt-get install python2.7-dev python3.5-dev
, where i changed it to python3.6, since my linux doesnt have python3.5.Uh no, this isn't raspberry pi, this is on my pc. It is nvidia GE MTX 130 series if that helps.
@berak Im just afraid that the recent version will be incompatible
please add the cmake console output to your question (it's rather long)
what do you mean -- "incompatible" ?
get recent github src, and build from that ! (don't rely on ubuntu's ppm, which will only drag in outdated stuff)
That fine with nvidia GE MTX 130. But it didn't tell u how many cores. Unfortunately, u can't do
make -j4
. U merely have one core that ismake -j1
Kindly, do not used link that is outdated. U don't needed to do thissudo apt-get install python2.7-dev python3.5-dev
. U can download manual python 3.10. U can also download OpenCV 4.5.1-pre. It will works on linux too. Used pyimagesearch or learnopencv from website.When I checked the nproc command, I get 8. I wanted to use the opencv as a dependecy for a application called Yolov4 . Can it work if I got a higher version of opencv
It will not work on older opencv version. YOLO have been released named YOLO v4, YOLO v5 and PP-YOLO will work on OpenCV 4 or later. Are you going to install latest OpenCV 4.5.x version or not?
in that case, try latest 3.4.12 release
(and no, opencv4 probably won't work, since the darknet code relies on deprecated c-api functionality, which was removed in opencv4)
@berak so i tried to install 3.4.12, and i followed this: https://linuxize.com/post/how-to-inst...
on step 2, instead of
since that would install 4.5, i did:
then i did this:
which resulted in this:
what did i not do properly, thanks for reading this.
on the error log:
Build output check failed: Regex: 'command[- ]line option .* is valid for .* but not for C' Output line: 'cc1: warning: command line option ‘-Wsign-promo’ is valid for C++/ObjC++ but not for C' Compilation failed: source file: '/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp/src.c' check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo' ===== BUILD LOG ===== Change Dir: /home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp
CheckIncludeFile.c /home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: sys/videoio.h: No such file or directory #include <sys videoio.h=""> ^~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/cmTC_1284a.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_1284a.dir/CheckIncludeFile.c.o' failed make[1]: * [CMakeFiles/cmTC_1284a.dir/CheckIncludeFile.c.o] Error 1 make[1]: Leaving directory '/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_1284a/fast' failed make: * [cmTC_1284a/fast] Error 2
and this:
#include <linux videodev.h=""> ^~~~~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/cmTC_345d8.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_345d8.dir/CheckIncludeFile.c.o' failed make[1]: * [CMakeFiles/cmTC_345d8.dir/CheckIncludeFile.c.o] Error 1 make[1]: Leaving directory '/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_345d8/fast' failed make: * [cmTC_345d8/fast] Error 2
^^ please edit your question, and put all this information there, not into comments, where it will get truncated and be unreadable
also, all those errors seem to be from the cmakeerror.log, where it tries to test your compiler/dev env, and are irrelevant
Does this help from berak's answer
Oh it does. But may I ask if the opencv version required changes whether I use the YOLO from darknet or its opencv ?