4.切换系统python版本
bash
sudo update-alternatives --config python
5.切换系统gcc版本
bash
sudo update-alternatives --config gcc
5.查看opencv版本
bash
pkg-config opencv --modversion
查看cuda版本
bash
cat /usr/local/cuda/version.txt
或者
bash
nvcc -V
查看cudnn版本
bash
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
查看prototbuf版本
bash
protoc --version
bash
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*
bash
sudo apt-get install cmake libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libpng-dev libtiff-dev libtiff5-dev libswscale-dev libjasper-dev libcurl4-openssl-dev libtbb2 libdc1394-22-dev libavresample-dev libgphoto2-dev
bash
mkdir build
cd build
bash
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
bash
sudo make -j4
bash
sudo make install