Python3.6
、GPU
、Opencv4.1
环境的安装sudo apt-get install git gitk
sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get install python3-tk
sudo apt-get install ipython3
sudo apt-get install python3-dbg
sudo apt-get install python3-numpy
sudo apt-get install python3-scipy
sudo apt-get install python3-matplotlib
sudo apt-get install python3-pandas
sudo -H pip3 install jupyter
sudo apt-get install build-essential cmake unzip pkg-config
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3-dev
cd opencv4.1.0
mkdir build
cd build
切记 local .. 后面的两点
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make -j8
sudo make install
pythn3.6
和 c++
的 opencv 环境Ubuntu18.04 + cudn9.0 + cudnn7.05
sudo vim /etc/modprobe.d/blacklist.conf
blacklist nouveau
options nouveau modeset=0
lspci | grep -i nvidia
ubuntu-drivers devices
sudo apt-get install nvidia-driver-430
nvida-smi
sudo apt-get install gcc-4.8
sudo apt-get install g++-4.8
cd /usr/bin/
ls -l gcc*
sudo mv gcc gcc.back
sudo ln -s gcc-4.8 gcc
ls -l g++*
sudo mv g++ g++.back
sudo ln -s g++-4.8 g++
sudo ./cuda_9.0.176_384.81_linux.run
Do you accept the previously read EULA?
accept/decline/quit: accept
You are attempting to install on an unsupported configuration. Do you wish to continue?
(y)es/(n)o [ default is no ]: y
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
(y)es/(n)o/(q)uit: n
Install the CUDA 9.0 Toolkit?
(y)es/(n)o/(q)uit: y
Enter Toolkit Location
[ default is /usr/local/cuda-9.0 ]: y
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y
Install the CUDA 9.0 Samples?
(y)es/(n)o/(q)uit: y
sudo ./cuda_9.0.176.1_linux.run
Do you accept the previously read EULA?
accept/decline/quit: accept
sudo ./cuda_9.0.176.2_linux.run
Do you accept the previously read EULA?
accept/decline/quit: accept
sudo ./cuda_9.0.176.3_linux.run
Do you accept the previously read EULA?
accept/decline/quit: accept
sudo ./cuda_9.0.176.4_linux.run
Do you accept the previously read EULA?
accept/decline/quit:accept
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
cat /usr/local/cuda/version.txt
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
sudo vim .bashrc
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
source ~/.bashrc
pip3 install tensorflow-gpu==1.6.0
pip3 install keras==2.1.5
pip3 install torch
pip3 install torchvision
pip3 install h5py
pip3 install pillow
pip3 install visdom
...
tensorflow c++ 环境我接下来会详细介绍
,感兴趣的请接下来关注。