Ask Your Question
0

installing 3.4.12 for ubuntu 18.04 LTS (install from source) for yolov4

asked 2020-12-02 03:06:03 -0600

ryan227 gravatar image

updated 2020-12-04 03:38:58 -0600

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...

edit retag flag offensive close merge delete

Comments

What cmake configuration options did you use? Did you try compiling it without OpenCL support?

kbarni gravatar imagekbarni ( 2020-12-02 04:10:52 -0600 )edit

please also try with a more recent version, 3.4.0 is years old, and noone can reproduce your problems anymore

berak gravatar imageberak ( 2020-12-02 04:30:14 -0600 )edit

Before u installed opencv3.4.0. Didn't u update and upgrade before ?

supra56 gravatar imagesupra56 ( 2020-12-02 07:56:57 -0600 )edit
1

i did update and upgrade

ryan227 gravatar imageryan227 ( 2020-12-02 08:28:59 -0600 )edit

R u on raspberry pi? What's model?

supra56 gravatar imagesupra56 ( 2020-12-02 08:31:05 -0600 )edit

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.

ryan227 gravatar imageryan227 ( 2020-12-02 08:35:55 -0600 )edit

Uh no, this isn't raspberry pi, this is on my pc. It is nvidia GE MTX 130 series if that helps.

ryan227 gravatar imageryan227 ( 2020-12-02 08:38:14 -0600 )edit

@berak Im just afraid that the recent version will be incompatible

ryan227 gravatar imageryan227 ( 2020-12-02 08:41:18 -0600 )edit

How do i check my cmake configuration options,

please add the cmake console output to your question (it's rather long)

berak gravatar imageberak ( 2020-12-02 08:43:34 -0600 )edit

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)

berak gravatar imageberak ( 2020-12-02 08:45:27 -0600 )edit

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 is make -j1 Kindly, do not used link that is outdated. U don't needed to do this sudo 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.

supra56 gravatar imagesupra56 ( 2020-12-02 09:18:43 -0600 )edit

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

ryan227 gravatar imageryan227 ( 2020-12-03 07:57:16 -0600 )edit

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?

supra56 gravatar imagesupra56 ( 2020-12-03 08:26:59 -0600 )edit

I wanted to use the opencv as a dependecy for a application called Yolov4

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 gravatar imageberak ( 2020-12-03 09:21:15 -0600 )edit

@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

 git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git

since that would install 4.5, i did:

 https://github.com/opencv/opencv/archive/3.4.12.zip -O opencv-3.4.12.zip
https://github.com/opencv/opencv_contrib/archive/3.4.12.zip -O opencv_contrib-3.4.12.zip
unzip opencv-3.4.12.zip
unzip opencv_contrib-3.4.12.zip
ryan227 gravatar imageryan227 ( 2020-12-03 21:22:32 -0600 )edit

then i did this:

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib-3.4.12/modules\>     -D BUILD_EXAMPLES=ON ..
ryan227 gravatar imageryan227 ( 2020-12-03 21:23:08 -0600 )edit

which resulted in this:

Configuring incomplete, errors occurred!
See also "/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeOutput.log".
See also "/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeError.log".
ryan227 gravatar imageryan227 ( 2020-12-03 21:24:31 -0600 )edit

what did i not do properly, thanks for reading this.

ryan227 gravatar imageryan227 ( 2020-12-03 21:26:04 -0600 )edit

on the error log:

    enter codBuild output check failed:
    Regex: 'argument .* is not valid'
    Output line: 'cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid 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=non-virtual-dtor'
===== BUILD LOG =====
Change Dir: /home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp
e here
ryan227 gravatar imageryan227 ( 2020-12-03 21:49:34 -0600 )edit

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

    Run Build Command:"/usr/bin/make" "cmTC_5f46e/fast"
ryan227 gravatar imageryan227 ( 2020-12-03 21:50:34 -0600 )edit

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

ryan227 gravatar imageryan227 ( 2020-12-03 21:51:47 -0600 )edit

and this:

/home/ryan/opencv_build/opencv-3.4.12/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: linux/videodev.h: No such file or directory

#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

ryan227 gravatar imageryan227 ( 2020-12-03 21:52:37 -0600 )edit

^^ 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

berak gravatar imageberak ( 2020-12-04 01:39:19 -0600 )edit

Does this help from berak's answer

supra56 gravatar imagesupra56 ( 2020-12-05 07:19:21 -0600 )edit
1

Oh it does. But may I ask if the opencv version required changes whether I use the YOLO from darknet or its opencv ?

ryan227 gravatar imageryan227 ( 2020-12-05 12:13:52 -0600 )edit

It will not change. U may ask @berak.

supra56 gravatar imagesupra56 ( 2020-12-05 15:31:48 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2020-12-05 03:41:12 -0600

updated 2020-12-05 03:42:42 -0600

How to Clone a Specific Branch?

git clone --branch 3.4 https://github.com/opencv/opencv.git
edit flag offensive delete link more

Comments

Will this upload the latest of 3.4?

ryan227 gravatar imageryan227 ( 2020-12-05 21:12:02 -0600 )edit

yes this will download the latest of 3.4

sturkmen gravatar imagesturkmen ( 2020-12-06 01:27:54 -0600 )edit

yes this works thank you

ryan227 gravatar imageryan227 ( 2020-12-08 21:17:49 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-12-02 03:06:03 -0600

Seen: 1,280 times

Last updated: Dec 05 '20