Caffe+CUDA8.0+CuDNNv5.1+OpenCV3.1+Ubuntu14.04 配置参考文献 以及 常见编译问题总结

Ubuntu + Deep Learning (Caffe, PyTorch)  配置参考文献

 

sudo apt install nvidia-cuda-toolkit  

pip install gpustat

watch --color -n1 gpustat -cpu

 

[Note]: the RTX3080 GPUs can only be used when cuda>=11 version:

 

conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia

pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

 

* Ubuntu system: how to compress a large-scale folder into multiple zip files (each one is about 18.9 GB): 

zip -r -s 18000m VisEvent_train.zip train_subset/

 

 

 

 

 

 

 

Q. Error mount: unknown filesystem type exfat on Ubuntu: [Solution can be found here

 

A: exFAT filesystem is not installed in Ubuntu by default, so you need to install Exfat filesystem. exFAT is proprietary and patented by Microsoft. 

sudo apt-add-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse-exfat

If you see the error gpg: “tag:launchpad.net:2008:redacted” not a key ID: skipping during the apt-add-repository step,

then you will need to manually install the signing key and run the apt-get update and apt-get install steps after that: 

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4DF9B28CA252A784
$ sudo apt-get update
$ sudo apt-get install exfat-fuse exfat-utils

Then, you can check again about your disk to see whether it works. Good Luck. 

 

 

 

 

 

 

 

 

apt-get update时卡在 waiting for headers,等了好久,最后报出Hash Sum mismatch的错误
解决方法:
rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get update
————————————————
版权声明:本文为CSDN博主「chansonzhang」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zc123456zzc/article/details/47153913

 

 

Issue: ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found   

参考:(28条消息) 【问题记录】ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21‘ not found_littlemichelle的博客-CSDN博客 

1. $ vim /home/wangxiao/.bashrc 

2. 在打开的文件中添加:export LD_LIBRARY_PATH=/home/wangxiao/anaconda3/lib:$LD_LIBRARY_PATH 

3. $ source /home/wangxiao/.bashrc 

4. 重新启动虚拟环境,应该就正常了。

 

 

1.备份原始源文件source.list

桌面打开终端,执行命令:sudo  cp   /etc/apt/sources.list   /etc/apt/sources.list.bak

2.修改源文件sources.list

(1)终端执行命令:sudo  chmod  777  /etc/apt/sources.list   更改文件权限使其可编辑;

(2)执行命令:  sudo  gedit   /etc/apt/sources.list    打开文件进行编辑;  

(3)删除原来的文件内容,复制下面的任意一个到其中并保存(常用的是阿里源和清华源,推荐阿里源); 

1

2

3

4

5

6

7

8

9

10

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

3.更新源

桌面终端执行命令:sudo apt update  更新软件列表,换源完成。 

##################################################### 

##     虚拟环境的配置,激活与使用

##################################################### 

1. 创建环境并且激活环境: 

conda create --name pysot python=3.7
conda activate pysot 

创建虚拟环境时,指定虚拟环境的路径:
conda create -p /home/cvpruser/zsf/wangxiao/TIP_convlstmTANet_master/pygan python=3.7
conda activate /home/cvpruser/zsf/wangxiao/TIP_convlstmTANet_master/pygan

2. 安装 其他图像视频处理中常用的依赖项: 

## the torch and cuda version should be consistent, or it will show you errors: RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS, when using the RNN model. 

conda install numpy pytorch=0.4.1 torchvision cuda92 -c pytorch    

pip --default-timeout=60000 install torch==1.5.0+cu92 torchvision==0.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

conda install numpy pytorch=1.2.0 torchvision cuda90 -c pytorch
conda install pytorch=1.2.0 torchvision cudatoolkit=10.0 -c pytorch 
pip --default-timeout=6000 install torch==1.3.0+cu100 torchvision==0.4.1+cu100 -f https://download.pytorch.org/whl/torch_stable.html
pip --default-timeout=6000 install opencv-python pyyaml yacs tqdm colorama matplotlib cython tensorboardX

 

0.1.2, 0.1.2.post1, 0.1.2.post2, 0.1.7.post2, 0.1.8.post1, 0.1.9.post1, 0.1.9
.post2, 0.1.10.post1, 0.1.10.post2, 0.1.11.post4, 0.1.11.post5, 0.1.12.post1, 0.1.12.post2, 0.2.0.post1, 0.2.0.post2, 0.2.0.post3, 0.3.0, 0.3.0.post2, 0.3.0.post3, 0.3.0.post4, 
0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.2.0+cpu, 1.2.0+cu92, 1.3.0, 1.3.0+cpu, 1.3.0+cu100, 1.3.0+cu92, 1.3.1, 1.3.1+cpu, 1.3.1+cu100, 1.3.1+cu92, 1.4.0,
 1.4.0+cpu, 1.4.0+cu100, 1.4.0+cu92, 1.5.0, 1.5.0+cpu, 1.5.0+cu101, 1.5.0+cu92, 1.5.1, 1.5.1+cpu, 1.5.1+cu101, 1.5.1+cu92, 1.6.0, 1.6.0+cpu, 1.6.0+cu101, 1.6.0+cu92, 1.7.0, 1.7.
0+cpu, 1.7.0+cu101, 1.7.0+cu110, 1.7.0+cu92, 1.7.1, 1.7.1+cpu, 1.7.1+cu101, 1.7.1+cu110, 1.7.1+cu92, 1.7.1+rocm3.7, 1.7.1+rocm3.8, 1.8.0, 1.8.0+cpu, 1.8.0+cu101, 1.8.0+cu111, 1.
8.0+rocm3.10, 1.8.0+rocm4.0.1, 1.8.1, 1.8.1+cpu, 1.8.1+cu101, 1.8.1+cu102, 1.8.1+cu111, 1.8.1+rocm3.10, 1.8.1+rocm4.0.1, 1.9.0, 1.9.0+cpu, 1.9.0+cu102, 1.9.0+cu111, 1.9.0+rocm4.
0.1, 1.9.0+rocm4.1, 1.9.0+rocm4.2

 

 

Install Google Chrome: 

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 

 

Install Mac Appearance for Ubuntu system via a single operation: bash ubuntu2mac.sh 

#!/bin/bash

# Transform Ubuntu 18.04 or Linux Mint 19 to MacBuntu
# https://www.noobslab.com/2018/08/macbuntu-1804-transformation-pack-ready.html

# If you want to change another version Ubuntu or Linux Mint?
# Search MacBuntu for your version on https://www.noobslab.com/search?q=MacBuntu

# Setup workspace
WORKSPACE=/home/wangxiao/macbuntu
mkdir $WORKSPACE

# Download MacBuntu OS Wallpapers
mkdir $WORKSPACE/wallpapers/
wget -qO- http://drive.noobslab.com/data/Mac/MacBuntu-Wallpapers.zip | busybox unzip - -d $WORKSPACE/wallpapers/ && mv $WORKSPACE/wallpapers/MacBuntu-Wallpapers $WORKSPACE/wallpapers/macbuntu

# Download default macOS 5K wallpapers
# https://512pixels.net/projects/default-mac-wallpapers-in-5k/
mkdir $WORKSPACE/wallpapers/5k
# wget http://512pixels.net/downloads/macos-wallpapers/10-0_10.1.png -P $WORKSPACE/wallpapers/5k
cat <<EOF | xargs -P 0 wget -P $WORKSPACE/wallpapers/5k
http://512pixels.net/downloads/macos-wallpapers/10-0_10.1.png
http://512pixels.net/downloads/macos-wallpapers/10-2.png
http://512pixels.net/downloads/macos-wallpapers/10-3.png
http://512pixels.net/downloads/macos-wallpapers/10-4.png
http://512pixels.net/downloads/macos-wallpapers/10-5.png
http://512pixels.net/downloads/macos-wallpapers/10-6.png
http://512pixels.net/downloads/macos-wallpapers/10-7.png
http://512pixels.net/downloads/macos-wallpapers/10-8.jpg
http://512pixels.net/downloads/macos-wallpapers/10-9.jpg
http://512pixels.net/downloads/macos-wallpapers/10-10.jpg
http://512pixels.net/downloads/macos-wallpapers/10-11.jpg
http://512pixels.net/downloads/macos-wallpapers/10-12.jpg
http://512pixels.net/downloads/macos-wallpapers/10-13.jpg
https://512pixels.net/downloads/macos-wallpapers/10-14-Day.jpg
https://512pixels.net/downloads/macos-wallpapers/10-14-Night.jpg
http://512pixels.net/downloads/macos-wallpapers/10-15-beta-light.jpg
http://512pixels.net/downloads/macos-wallpapers/10-15-beta-dark.jpg
EOF

# Enter these commands in terminal to get themes, icons and cursors.
# Terminal Commands:
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-icons-v1804
sudo apt-get install macbuntu-os-ithemes-v1804
# After installation choose theme, icons and mac cursor from tweak tool.


# Uninstall themes and icons
# sudo apt-get remove macbuntu-os-icons-v1804 macbuntu-os-ithemes-v1804


# Install Slingscold (Alternative to Launchpad)
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install slingscold


# Install Albert Spotlight (Alternative to Mac Spotlight)
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install albert


# Install Plank Dock
sudo apt-get install plank


# Install themes for Plank dock
sudo apt-get install plank


# Install themes for Plank dock
sudo add-apt-repository ppa:noobslab/macbuntu
sudo apt-get update
sudo apt-get install macbuntu-os-plank-theme-v1804


# Uninstall Plank dock themes
# sudo apt-get autoremove plank macbuntu-os-plank-theme-v1804


# Install Tweak Tools to change Themes & Icons
sudo apt-get install gnome-tweak-tool


# Install Monochrome icons for Libreoffice
sudo apt-get install libreoffice-style-sifr


# Optional
# Install macOS fonts
# After installation, You can change fonts from Unity-Tweak-Tool, Gnome-Tweak-Tool.
wget -O mac-fonts.zip http://drive.noobslab.com/data/Mac/macfonts.zip
sudo unzip mac-fonts.zip -d /usr/share/fonts && rm mac-fonts.zip
sudo fc-cache -f -v
View Code

 

Ubuntu open or close 触摸板: [Source]

方法一:直接关闭

查看有哪些仪器在使用

$ xinput list

(base) wangxiao@wx:~$ xinput list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SYNA1202:00 06CB:CD9F Touchpad            id=12   [slave  pointer  (2)]
⎜   ↳ PixArt Dell MS116 USB Optical Mouse       id=17   [slave  pointer  (2)]
⎜   ↳ SONiX USB DEVICE                          id=16   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Video Bus                                 id=8    [slave  keyboard (3)]
    ↳ Power Button                              id=9    [slave  keyboard (3)]
    ↳ Sleep Button                              id=10   [slave  keyboard (3)]
    ↳ BisonCam,NB Pro: BisonCam,NB Pr           id=11   [slave  keyboard (3)]
    ↳ Intel HID events                          id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ SONiX USB DEVICE                          id=15   [slave  keyboard (3)]

看到Touchpad就是触摸板,它的id=12, 使用命令关闭或者开启它

# 关闭----0就是关闭
(base) wangxiao@wx:~$ xinput set-prop 'SYNA1202:00 06CB:CD9F Touchpad'  'Device Enabled' 0
# 开启
(base) wangxiao@wx:~$ xinput set-prop 'SYNA1202:00 06CB:CD9F Touchpad'  'Device Enabled' 1

 

方法二:命令式关闭和开启

打开~/.bashrc

sudo gedit ~/.bashrc 

添加快捷命令, 在文件里的最后一行,添加方法一中找到触摸板名字和ID。

alias tpOff="xinput set-prop 'SYNA1202:00 06CB:CD9F Touchpad' 'Device Enabled' 0" 
alias tpOn="xinput set-prop 'SYNA1202:00 06CB:CD9F Touchpad' 'Device Enabled' 1"

使用关闭和命令的快件语句, 打开终端后,只需要输入tpOff就可以关闭触摸板了,同理打开也是这样了. 

 

 

 

1. 首先安装 cuda 

sudo apt-get update
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
sudo apt-get install cuda

 

Install CUDA Toolkit 11.2: 

Linkhttps://developer.nvidia.com/cuda-toolkit-archive 

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-ubuntu1604.pin
sudo mv cuda-ubuntu1604.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda-repo-ubuntu1604-11-2-local_11.2.2-460.32.03-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604-11-2-local_11.2.2-460.32.03-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1604-11-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
#查看pytorch版本
import torch
torch.__version__ 

#查看pytorch版本对应的cuda版本
torch.version.cuda

#查看cuda是否可用
torch.cuda.is_available()
重新设置cuda的软链接为cuda10
sudo rm -rf /usr/local/cuda
sudo ln -s /usr/local/cuda-10.0 /usr/local/cuda

查看版本
nvcc -V

 

  • ubuntu挂载移动硬盘出现错误:mount:unknown filesystem type 'exfat': 只需要简单地执行如下命令,安装 exfat-fuse 软件即可。其他无需任何操作,实测好用。
sudo apt-get install exfat-fuse

 


 

 

 

2. 安装基本依赖项: 

 

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler  
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install python-skimage ipython python-pil python-h5py ipython python-gflags python-yaml  
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev  

 

3. 设置环境变量:

export PATH=/usr/local/cuda-8.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

也可以在 /etc/profile中进行编辑, 在最后加入:

exportPATH=/usr/local/cuda-8.0/bin:$PATH
exportLD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

4. 设置CUDA-7.5 SAMPLES:

 

cuda-install-samples-8.0.sh  ~  
cd ~/NVIDIA_CUDA-8.0_Samples  
cd 1_Utilities/deviceQuery  
make

进入NVIDIA_CUDA-8.0_Samples 会编译很长时间,耐心等待。

执行测试代码: deviceQuery,如果成功结尾会是Result = PASS

此处,可能因为gcc或者g++版本问题,导致无法编译。重新安装一个较老的版本gcc-4.7,然后添加对应的软连接即可编译: 

sudo apt-get install -y gcc-4.7
sudo apt-get install -y g++-4.7  
cd /usr/bin
sudo rm gcc 
sudo ln -s gcc-4.7 gcc 
sudo rm g++ 
sudo ln -s g++-4.7 g++ 
#### check it's success or not ? 
ls -al gcc g++ 
gcc --version
g++ --version

Source: https://stackoverflow.com/questions/48398475/fail-to-install-gcc-4-9-in-ubuntu17-04 

 

It seems that gcc-4.9.4 is indeed missing from the main repository, which has only gcc-4.9.3http://us.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-4.9

 

This explains the 404 Not Found error from apt.
As a first fix attempt, you may try the following, just in case there's a conflict which apt will be able to repair:

 

sudo apt-get update --fix-missing
sudo apt-get dist-upgrade
sudo apt-get install gcc-4.9 g++-4.9 gcc-4.9-multilib

 

Ubuntu 16.04

On Ubuntu 16.04, gcc-4.9 could be installed from the Launchpad Toolchain repository:

sudo apt-add-repository -yu 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main'
sudo apt update
sudo apt-get install gcc-4.9 g++-4.9 gcc-4.9-multilib

 

Ubuntu 18.04 (and probably 17.10, 17.04)

If the above didn't work, you could go about installing gcc-4.9 manually along with all required dependencies, by grabbing the required packages and installing them by order, using dpkg:

 

mkdir ~/Downloads/gcc-4.9-deb && cd ~/Downloads/gcc-4.9-deb

wget http://launchpadlibrarian.net/247707088/libmpfr4_3.1.4-1_amd64.deb
wget http://launchpadlibrarian.net/253728424/libasan1_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728426/libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728314/gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728399/cpp-4.9_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728404/gcc-4.9_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728432/libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb
wget http://launchpadlibrarian.net/253728401/g++-4.9_4.9.3-13ubuntu2_amd64.deb

sudo dpkg -i gcc-4.9-base_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i libmpfr4_3.1.4-1_amd64.deb
sudo dpkg -i libasan1_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i libgcc-4.9-dev_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i cpp-4.9_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i gcc-4.9_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i libstdc++-4.9-dev_4.9.3-13ubuntu2_amd64.deb
sudo dpkg -i g++-4.9_4.9.3-13ubuntu2_amd64.deb

The above was tested on 18.04 and produced a functional installed gcc-4.9. 

如何安装多个版本的 gcc 和 g++,然后实现自动切换?

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update

sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50

sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --set c++ /usr/bin/g++

如果需要 gcc 3.4.6,还可以安装这2个包: 
gcc34 https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing 
g++34 https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing 
下载后用 sudo dpkg -i package_name 安装,然后执行:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc34 5
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++34 5

切换命令:

sudo update-alternatives --config gcc
sudo update-alternatives --config g++

5. 安装BLAS:  

sudo apt-get install libatlas-base-dev 

6. 安装其他依赖项:

sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

7. 安装opencv:

#[compiler]
sudo apt-get install build-essential  
#[required]
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev  
#[optional]
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev  

8. 安装cudnn: 

 解压cudnn的包(官网得申请,用网盘搜索能找到最新的),有include和lib64,里面文件复制到对应/usr/local/cuda/对应文件夹里

#进到对应文件夹
sudo cp cudnn.h /usr/local/cuda/include/  

#进到对应文件夹 sudo cp lib
* /usr/local/cuda/lib64/
#进行一次
sudo ldconfig
-v

9. 安装caffe:

Caffe

git clone https://github.com/BVLC/caffe.git  
cp Makefile.config.example Makefile.config  

修改Makefile.config,去掉cudnn的注释,其他的在当前应用场景可不变。

make all  
make test  
make runtest  

 

 

 

 

10. 安装matlab:

Many Tutorials online, we just ignore this part here. 

11. can not find "hdf5.h":

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include   /usr/include/hdf5/serial  
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib  /usr/lib/x86_64-linux-gnu/hdf5/serial

12. 编译caffe的时候,提示:
CXX examples/cifar10/convert_cifar_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:563: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
wangxiao@GTX980:~/Downloads/caffe-master$
-------------------

怎么破?

do as issue 12. Change the Makefile.config: 

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include   /usr/include/hdf5/serial  
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib  /usr/lib/x86_64-linux-gnu/hdf5/serial

 

 13. 安装 MKL:

 

MKL与CUDA的环境设置

1. 新建intel_mkl.conf, 并编辑之:

         $ sudo gedit /etc/ld.so.conf.d/intel_mkl.conf

         /opt/intel/lib/intel64

         /opt/intel/mkl/lib/intel64

2. 新建cuda.conf,并编辑之:

         $ sudo gedit /etc/ld.so.conf.d/cuda.conf

         /usr/local/cuda/lib64

         /lib

3. 完成lib文件的链接操作,执行:

         $ sudo ldconfig –v

 

  

 

 15. 可能需要添加的东西:

配置Makefile文件(实现对OpenCV3.x的支持)

查找“Derive include and lib directories”一节,修改“LIBRARIES +=”的最后一行,增加opencv_imgcodecs

opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs

 16. 运行caffe案例:

1. 数据预处理

$ sudo shdata/mnist/get_mnist.sh

2. 重建lmdb文件。Caffe支持三种数据格式输入网络,包括Image(.jpg, .png等),leveldb,lmdb,根据自己需要选择不同输入吧。

$sudo shexamples/mnist/create_mnist.sh

生成mnist-train-lmdb 和 mnist-train-lmdb文件夹,这里包含了lmdb格式的数据集

注:我执行此命令的时候报告说not in gzformat,后来发现是联网下载的mnist数据有问题,然后我就去网上了下载了mnist数据集,后在ubuntu上手动解压的,再执行后面的命令。

3. 训练mnist
$ sudo shexamples/mnist/train_lenet.sh

 17. when compile caffe:

  1 wangxiao@GTX980:~/Downloads/35attribute_caffe_master_$ make -j8
  2 CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
  3 CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
  4 CXX/LD -o .build_release/tools/compute_image_mean.bin
  5 CXX/LD -o .build_release/tools/caffe.bin
  6 CXX/LD -o .build_release/tools/convert_imageset.bin
  7 CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
  8 CXX/LD -o .build_release/examples/mnist/convert_mnist_data.bin
  9 CXX/LD -o .build_release/tools/extract_features.bin
 10 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
 11 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
 12 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
 13 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
 14 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
 15 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
 16 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
 17 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
 18 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
 19 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
 20 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
 21 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
 22 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
 23 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
 24 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
 25 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
 26 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
 27 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
 28 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
 29 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
 30 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
 31 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
 32 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
 33 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
 34 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
 35 collect2: error: ld returned 1 exit status
 36 Makefile:616: recipe for target '.build_release/tools/caffe.bin' failed
 37 make: *** [.build_release/tools/caffe.bin] Error 1
 38 make: *** Waiting for unfinished jobs....
 39 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
 40 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
 41 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
 42 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
 43 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
 44 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
 45 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
 46 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
 47 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
 48 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
 49 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
 50 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
 51 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
 52 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
 53 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
 54 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
 55 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
 56 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
 57 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
 58 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
 59 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
 60 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
 61 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
 62 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
 63 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
 64 collect2: error: ld returned 1 exit status
 65 Makefile:616: recipe for target '.build_release/tools/upgrade_net_proto_text.bin' failed
 66 make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1
 67 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
 68 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
 69 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
 70 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
 71 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
 72 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
 73 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
 74 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
 75 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
 76 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
 77 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
 78 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
 79 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
 80 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
 81 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
 82 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
 83 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
 84 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
 85 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
 86 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
 87 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
 88 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
 89 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
 90 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
 91 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
 92 collect2: error: ld returned 1 exit status
 93 Makefile:616: recipe for target '.build_release/tools/upgrade_solver_proto_text.bin' failed
 94 make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1
 95 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
 96 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
 97 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
 98 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
 99 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
100 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
101 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
102 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
103 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
104 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
105 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
106 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
107 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
108 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
109 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
110 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
111 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
112 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
113 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
114 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
115 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
116 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
117 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
118 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
119 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
120 collect2: error: ld returned 1 exit status
121 Makefile:616: recipe for target '.build_release/tools/convert_imageset.bin' failed
122 make: *** [.build_release/tools/convert_imageset.bin] Error 1
123 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
124 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
125 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
126 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
127 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
128 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
129 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
130 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
131 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
132 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
133 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
134 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
135 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
136 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
137 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
138 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
139 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
140 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
141 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
142 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
143 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
144 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
145 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
146 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
147 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
148 collect2: error: ld returned 1 exit status
149 Makefile:621: recipe for target '.build_release/examples/mnist/convert_mnist_data.bin' failed
150 make: *** [.build_release/examples/mnist/convert_mnist_data.bin] Error 1
151 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
152 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
153 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
154 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
155 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
156 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
157 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
158 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
159 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
160 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
161 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
162 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
163 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
164 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
165 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
166 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
167 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
168 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
169 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
170 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
171 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
172 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
173 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
174 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
175 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
176 collect2: error: ld returned 1 exit status
177 Makefile:616: recipe for target '.build_release/tools/extract_features.bin' failed
178 make: *** [.build_release/tools/extract_features.bin] Error 1
179 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
180 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
181 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
182 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
183 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
184 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
185 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
186 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
187 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
188 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
189 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
190 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
191 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
192 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
193 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
194 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
195 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
196 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
197 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
198 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
199 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
200 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
201 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
202 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
203 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
204 collect2: error: ld returned 1 exit status
205 Makefile:616: recipe for target '.build_release/tools/compute_image_mean.bin' failed
206 make: *** [.build_release/tools/compute_image_mean.bin] Error 1
207 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_ndims'
208 .build_release/lib/libcaffe.so: undefined reference to `H5Fcreate'
209 .build_release/lib/libcaffe.so: undefined reference to `H5check_version'
210 .build_release/lib/libcaffe.so: undefined reference to `H5Lget_name_by_idx'
211 .build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
212 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_double'
213 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_int'
214 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_float'
215 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_float'
216 .build_release/lib/libcaffe.so: undefined reference to `H5Gget_info'
217 .build_release/lib/libcaffe.so: undefined reference to `H5Gopen2'
218 .build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
219 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_double'
220 .build_release/lib/libcaffe.so: undefined reference to `H5LTmake_dataset_string'
221 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_int'
222 .build_release/lib/libcaffe.so: undefined reference to `H5Fclose'
223 .build_release/lib/libcaffe.so: undefined reference to `H5Gclose'
224 .build_release/lib/libcaffe.so: undefined reference to `H5LTfind_dataset'
225 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
226 .build_release/lib/libcaffe.so: undefined reference to `H5Lexists'
227 .build_release/lib/libcaffe.so: undefined reference to `H5Gcreate2'
228 .build_release/lib/libcaffe.so: undefined reference to `H5LTget_dataset_info'
229 .build_release/lib/libcaffe.so: undefined reference to `H5LTread_dataset_string'
230 .build_release/lib/libcaffe.so: undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
231 .build_release/lib/libcaffe.so: undefined reference to `H5Fopen'
232 collect2: error: ld returned 1 exit status
233 Makefile:616: recipe for target '.build_release/tools/upgrade_net_proto_binary.bin' failed
234 make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1
235 wangxiao@GTX980:~/Downloads/35attribute_caffe_master_$ 
View Code

what the fuck :::

...

 

OK, 改为ubuntu Kylic版本了,哎,还是麒麟好用啊。。。坑逼


 

18. when use the matlab demo from caffe file:

  after make matcaffe, and it warning me it's OK. and when run the demo, it shown me the errors like this:

  Invalid MEX-file '/home/wangxiao/Downloads/caltech_256_caffe_master/matlab/+caffe/private/caffe_.mexa64': libcudart.so.7.5: cannot open shared object file: No such file or directory 

  What should I do for this ??

  

   You must remember the following operation, because it really worked well ! Yeah !!!


 

  error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory

  32-bit:   sudo ldconfig /usr/local/cuda/lib

  64-bit:   sudo ldconfig /usr/local/cuda/lib64

 

  今天悲剧的发现, 执行了 64-bit 之后出现错误:   

  wangxiao@AHU:~/Downloads/caffe-master$ sudo ldconfig /usr/local/cuda/lib64

  /sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.5 is not a symbolic link

  不知道问题何在啊?怎么解决???  

  ##############################################
  ## 有时候需要更新软链接:
  
  cd /usr/local/cuda/lib64/  

  sudo rm -rf libcudnn.so libcudnn.so.7.5  
  sudo ln -s libcudnn.so.7.5.48 libcudnn.so.7.5  
  sudo ln -s libcudnn.so.7.5 libcudnn.so  

 

19. When compile caffe, some times it always shown you a mistake like this:

CXX src/caffe/util/db_leveldb.cpp
In file included from src/caffe/util/signal_handler.cpp:7:0:
./include/caffe/util/signal_handler.h:4:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
^
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
make: *** [.build_release/src/caffe/util/signal_handler.o] Error 1
make: *** Waiting for unfinished jobs....
^Cmake: *** [.build_release/src/caffe/util/math_functions.o] Interrupt
make: *** [.build_release/src/caffe/net.o] Interrupt
make: *** wait: No child processes. Stop.

 

Do you how to solve this problem ???  Just becase the lost of the file : caffe.pb.h, and this file is actually generated from the process of compile. Do the following operation will help you solve the problem:

  Just input make in your terminal:  make 

  Then, press ctrl+c to stop it, and input: make -j8 

  All process will be normal now !

  Here is a figure to help you understand this all process.


 20. You also maybe meet a error like this:

CXX/LD -o .build_release/tools/net_speed_benchmark.bin
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1 

Just add a word in you Makefile, following:

LIBRARIES += opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs 

 

21. 利用caffe 的matlab借口提取feature的时候:碰到了这个问题:怎么破 ?

    

  Undefined function 'caffe_' for input arguments of type 'char'.

  Error in caffe.set_mode_gpu (line 5)
  caffe_('set_mode_gpu');

  Error in Copy_of_Label_all_ (line 11)
  caffe.set_mode_gpu();

 

  答:因为没有编译matlab接口,即:make matcaffe 执行这句,完了之后,你就发现,yeah,可以了。。。

 

22. protobuf 的下载与安装

  from: https://github.com/protocolbuffers/protobuf/tree/master/src

 

You can get the source by "git clone" our git repository. Make sure you have also cloned the submodules and generated the configure script (skip this if you are using a release .tar.gz or .zip package):

$ git clone https://github.com/protocolbuffers/protobuf.git
$ cd protobuf
$ git submodule update --init --recursive
$ ./autogen.sh
To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:

$ ./configure
$ make
$ make check
$ sudo make install
$ sudo ldconfig # refresh shared library cache.

 

 

 

  

23. 将 wide residual network 的 python 脚本生成 其对应的 protext 文件,出现问题:

wangxiao@AHU:~/Downloads/caffe-master$ python ./python/wide_residual_network.py
Traceback (most recent call last):
File "./python/wide_residual_network.py", line 62, in <module>
make_net(tgt_file)
File "./python/wide_residual_network.py", line 58, in make_net
print(resnet_cifar(depth=16, widen_factor=8), file=f)
File "./python/wide_residual_network.py", line 53, in resnet_cifar
return to_proto(loss, acc)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 50, in to_proto
top.fn._to_proto(layers, {}, autonames)
--------------------- 类似这种转换 ------- 此处略写 -----------------------
inp._to_proto(layers, names, autonames)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 97, in _to_proto
return self.fn._to_proto(layers, names, autonames)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 136, in _to_proto
inp._to_proto(layers, names, autonames)
AttributeError: 'NoneType' object has no attribute '_to_proto'
wangxiao@AHU:~/Downloads/caffe-master$

 

   搜到一个答案,但是不知所云:

    http://stackoverflow.com/questions/15232832/python-regex-attributeerror-nonetype-object-has-no-attribute-groups

  哎 坑啊 ...

 

24. 要用 CUDNN,因为训练速度会提升好几倍!!!

 

25. 编译 caffe 出现:

XX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory
#include "hdf5.h"
^
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/net.o' failed
make: *** [.build_release/src/caffe/net.o] Error 1
make: *** Waiting for unfinished jobs....
wangxiao@csdl:~/pedestrian_attributes/43_attribute_caffe_master_$ ^C
wangxiao@csdl:~/pedestrian_attributes/43_attribute_caffe_master_$

 那么,怎么解决这个问题?添加两行路径:

   /usr/include/hdf5/serial 

  /usr/lib/x86_64-linux-gnu/hdf5/serial

  

 

 26. caffe 配置 python 环境变量: 参考博文:http://blog.csdn.net/yingyujianmo/article/details/51014440

   

  添加环境变量 
    vim ~/.bashrc
  将export PYTHONPATH=/home/wanghh/caffe/python:$PYTHONPATH添加到文件中。 
    source ~/.bashrc
  这样,在其他地方打开python,也可以import caffe了。

 

  

 

 


27. caffe 配置 python, some times, it shown us: no module named caffe: 

  at this moment, maybe you should add those codes into your file, like :

  

  then, you can check it again. It will be OK. 

 

28. when install new softwares, I find this error: 

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
kate : Depends: kdelibs4c2a (>= 4:3.5.9) but it is not going to be installed
Depends: libqt3-mt (>= 3:3.3.8b) but it is not going to be installed
Recommends: kregexpeditor but it is not installable
kscope : Depends: kdelibs4c2a (>= 4:3.5.7-1) but it is not going to be installed
Depends: libaudio2 but it is not going to be installed
Depends: libqt3-mt (>= 3:3.3.8really3.3.7) but it is not going to be installed
Depends: cscope but it is not going to be installed
Depends: exuberant-ctags but it is not going to be installed
Depends: graphviz but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

 

try this operation on the terminal, it will solve this issue: 

==>> $: apt-get -f install    

 

29. when compile matconvnet, it shown me error like this: 

 

>> vl_compilenn('enableGpu', true, 'cudamethod','nvcc')
Warning: Function labindex has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
Warning: Function numlabs has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
Warning: Function labindex has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path at 109
In addpath at 86
In vl_compilenn at 144 
Warning: Function numlabs has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path at 109
In addpath at 86
In vl_compilenn at 144 
Warning: Function labindex has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path at 109
In addpath at 86
In vl_compilenn at 144 
Warning: Function numlabs has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict. 
> In path at 109
In addpath at 86
In vl_compilenn at 144 
vl_compilenn:	CUDA: MEX config file: '/home/wangxiao/Downloads/siamese-fc-master/matconvnet-1.0-beta20/matlab/src/config/mex_CUDA_glnxa64.xml'
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
Building with 'g++'.
MEX completed successfully.
/home/wangxiao/Downloads/siamese-fc-master/matconvnet-1.0-beta20/matlab/src/bits/impl/pooling_gpu.cu(163): error: function "atomicAdd(double *, double)" has already been defined

 

1 error detected in the compilation of "/tmp/tmpxft_000034d7_00000000-7_pooling_gpu.cpp1.ii".
Error using vl_compilenn>nvcc_compile (line 521)
Command "/usr/local/cuda-8.0/bin/nvcc" -c "/home/wangxiao/Downloads/siamese-fc-master/matconvnet-1.0-beta20/matlab/src/bits/impl/pooling_gpu.cu" -DNDEBUG -DENABLE_GPU
-DENABLE_DOUBLE -gencode=arch=compute_61,code=\"sm_61,compute_61\" -I"/usr/local/MATLAB/R2014b/extern/include"
-I"/usr/local/MATLAB/R2014b/toolbox/distcomp/gpu/extern/include" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -Xcompiler -fPIC -o
"/home/wangxiao/Downloads/siamese-fc-master/matconvnet-1.0-beta20/matlab/mex/.build/bits/impl/pooling_gpu.o" failed.

 

Error in vl_compilenn (line 466)
nvcc_compile(opts, srcs{i}, objfile, flags.nvcc) ;

  

==>> Update your MatConvnet version. It indeed contain such errors in this version. 

 

30. json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array escape 

when compile caffe file in SSD, it shown me the error like this: 

json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array escape 

Just like this blog said, you need do this: 

 

修改json_parser_read.hpp:打开文件夹Document,选中computer,在搜索json_parser_read.hpp,找到该文件的路径之后用如下命令打开

 

sudo gedit /usr/include/boost/property_tree/detail/json_parser_read.hpp

 

将257行开始的escape代码段注释掉即可,如下:

 

/*escape
                    =   chset_p(detail::widen<Ch>("\"\\/bfnrt").c_str())
                            [typename Context::a_escape(self.c)]
                    |   'u' >> uint_parser<unsigned long, 16, 4, 4>()
                            [typename Context::a_unicode(self.c)]
                    ;*/

 


 

31.  ImportError: No module named caffe.proto

wangxiao@AHU:~/Documents/caffe$ ./data/VOC0712/create_data.sh
Traceback (most recent call last):
File "/home/wangxiao/Documents/caffe/data/VOC0712/../../scripts/create_annoset.py", line 7, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "/home/wangxiao/Documents/caffe/data/VOC0712/../../scripts/create_annoset.py", line 7, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto 

 

Solution:   export PYTHONPATH=/home/wangxiao/Documents/caffe/python:$PYTHONPATH 

then, run: ./data/VOC0712/create_data.sh  

it will be OK. 

 


32. ImportError: No Module named caffe:

import sys

sys.path.append("/(你的caffe-master路径)/caffe-master/python")

sys.path.append("/(你的caffe-master路径)/caffe-master/python/caffe")  

 

33. OpenCV Error: 

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /io/opencv/modules/highgui/src/window.cpp, line 583 Traceback (most recent call last):   File "./show_tracker_vot.py", line 30, in <module>     objTrackerVis.trackAll(0, 1)   File "/home/wangxiao/Downloads/goTURN-tensorflow/PY-GOTURN-master/src/tracker_manager.py", line 55, in trackAll     cv2.imshow('input', sMatImage) cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage  

==>> do the following opeartions: 

1.Remove installed OpenCV version to avoid mess up later

pip3 uninstall opencv-python 
2.Lower you python version to 3.5(current version 3.6 has different problems with conda, which we will use to install OpenCV)

conda install python=3.5
3.Finally use conda, to install working version of OpenCV 

conda install -c menpo opencv3  
sudo apt-get install libgtk-3-dev 

  

 

34. when running a tensorflow code, it shown me a error: 

ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

==>> well, this is because the version of tensorflow. Currently, the most recent tensorflow is version 1.3.0, and it need cudnn v6+. but my machine still use the cudnn v5.1. 

Thus the error occured. You can sovle this problem by install tensorflow v1.2.0, as following:

sudo pip install --user tensorflow==1.2.0  

35. How to install keras with specific version, not the newest one ???  

sudo pip install keras==1.2

36. ankit@Ankit:~/caffe$ make all
CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)' .build_release/lib/libcaffe.so: undefined reference tocv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1 

Solution: 

 

1. add "opencv_imgcodecs" in Makefile.(opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs)

2. delete all the file in build(rm -rf ./build/*) before "make all". 

 

37. new issues about new version of cuda:  

CXX src/caffe/parallel.cpp
NVCC src/caffe/solvers/adadelta_solver.cu
nvcc fatal : Unsupported gpu architecture 'compute_20'
Makefile:576: recipe for target '.build_release/cuda/src/caffe/solvers/adadelta_solver.o' failed
make: *** [.build_release/cuda/src/caffe/solvers/adadelta_solver.o] Error 1
make: *** 正在等待未完成的任务....

==>> SOlution: from: https://askubuntu.com/questions/960238/nvcc-fatal-unsupported-gpu-architecture-compute-20  

 

  

38. when compile caffe on our linux server, following errors occured: 

/usr/include/c++/7/bits/exception_ptr.h(90): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(90): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(91): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(93): error: namespace "__cxxabiv1::std" has no member "make_exception_ptr"

/usr/include/c++/7/bits/exception_ptr.h(93): error: a template friend declaration cannot be declared in a local class

/usr/include/c++/7/bits/exception_ptr.h(93): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(96): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(98): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(101): error: incomplete type is not allowed

/usr/include/c++/7/bits/exception_ptr.h(101): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(122): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(132): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(149): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(150): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(153): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(158): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(159): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(162): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(163): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(166): error: use of a local type to declare a function

/usr/include/c++/7/bits/exception_ptr.h(167): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(179): error: expected a ";"

/usr/include/c++/7/bits/exception_ptr.h(214): error: expected a ";"

/usr/include/c++/7/bits/move.h(46): error: identifier "constexpr" is undefined

/usr/include/c++/7/bits/move.h(46): error: "_Tp" is not a function or static data member

/usr/include/c++/7/bits/move.h(51): error: expected a ";"

/usr/include/c++/7/type_traits(71): error: identifier "constexpr" is undefined

/usr/include/c++/7/type_traits(71): error: template parameter "_Tp" may not be redeclared in this scope

/usr/include/c++/7/type_traits(71): error: expected a ";"

/usr/include/c++/7/type_traits(72): error: member "__cxxabiv1::std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/7/type_traits(73): error: member "__cxxabiv1::std::integral_constant<_Tp, __v>::_Tp" is not a type name

/usr/include/c++/7/type_traits(74): error: identifier "constexpr" is undefined

/usr/include/c++/7/type_traits(74): error: expected a ";"

/usr/include/c++/7/type_traits(84): error: identifier "constexpr" is undefined

/usr/include/c++/7/type_traits(84): error: "_Tp" is not a function or static data member

/usr/include/c++/7/type_traits(93): error: expected a declaration

/usr/include/c++/7/type_traits(93): error: expected a ";"

/usr/include/c++/7/type_traits(126): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(154): error: __bool_constant is not a template

/usr/include/c++/7/type_traits(154): error: not a class or struct name

/usr/include/c++/7/type_traits(245): error: identifier "char16_t" is undefined

/usr/include/c++/7/type_traits(249): error: identifier "char32_t" is undefined

/usr/include/c++/7/type_traits(249): error: class "__cxxabiv1::std::__is_integral_helper<<error-type>>" has already been defined

/usr/include/c++/7/type_traits(362): error: namespace "__cxxabiv1::std" has no member "size_t"

/usr/include/c++/7/type_traits(463): error: expected a ">"

/usr/include/c++/7/type_traits(467): error: expected a ">"

/usr/include/c++/7/type_traits(475): error: expected a ">"

/usr/include/c++/7/type_traits(479): error: expected a ">"

/usr/include/c++/7/type_traits(487): error: expected a ">"

/usr/include/c++/7/type_traits(491): error: expected a ">"

/usr/include/c++/7/type_traits(499): error: expected a ">"

/usr/include/c++/7/type_traits(503): error: expected a ">"

/usr/include/c++/7/type_traits(511): error: expected a ">"

/usr/include/c++/7/type_traits(515): error: expected a ">"

/usr/include/c++/7/type_traits(523): error: expected a ">"

/usr/include/c++/7/type_traits(527): error: expected a ">"

/usr/include/c++/7/type_traits(535): error: expected a ">"

/usr/include/c++/7/type_traits(539): error: expected a ">"

/usr/include/c++/7/type_traits(547): error: expected a ">"

/usr/include/c++/7/type_traits(551): error: expected a ">"

/usr/include/c++/7/type_traits(561): error: namespace "__cxxabiv1::std" has no member "nullptr_t"

/usr/include/c++/7/type_traits(582): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(588): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(595): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(602): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(612): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(638): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(748): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(762): error: expected a ";"

/usr/include/c++/7/type_traits(777): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

/usr/include/c++/7/type_traits(787): error: expected a ")"

/usr/include/c++/7/type_traits(798): error: an explicit template argument list is not allowed on this declaration

/usr/include/c++/7/type_traits(798): error: expected a type specifier

/usr/include/c++/7/type_traits(798): error: function returning function is not allowed

/usr/include/c++/7/type_traits(798): error: expected a ";"

/usr/include/c++/7/type_traits(804): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_000038a7_00000000-13_conv_layer.compute_50.cpp1.ii".
Compilation terminated.
make: *** [Makefile:578: .build_release/cuda/src/caffe/layers/conv_layer.o] Error 1 

 

==>> still have no answer yet. 

 

39. Caffe-SSD compile error: 

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/include/boost/property_tree/detail/json_parser_read.hpp: In constructor ‘boost::property_tree::json_parser::json_grammar<Ptree>::definition<Scanner>::definition(const boost::property_tree::json_parser::json_grammar<Ptree>&)’:
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
escape
^
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
make: *** [.build_release/cuda/src/caffe/layers/detection_output_layer.o] Error 1

 

Answer from: https://github.com/BVLC/caffe/issues/4957 

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-5 g++-5
mona@pascal:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.1-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 
--enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=gcc4-compatible --disable-libstdcxx-dual-abi --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.1 20160904 (Ubuntu 5.4.1-2ubuntu1~14.04)

 At this moment, you already installed gcc and g++ V5 successfully. You just remove the old super-link and add the new one: 

 

cd /usr/bin
sudo rm gcc
sudo ln -s gcc-5 gcc
sudo rm g++
sudo ln -s g++-5 g++

 

40. 各种版本的 cudnn,百度云下载:

链接https://pan.baidu.com/s/1j_DzNZ2Lux95TQDjPQhoBQ 密码: sjrc 

 

41. fatal error: jpeglib.h: No such file or directory

 

Error using mex
/GFS-DCF/tracker_exter/matconvnet/matlab/src/bits/impl/imread_libjpeg.cpp:22:10:
fatal error: jpeglib.h: No such file or directory
#include <jpeglib.h>
^~~~~~~~~~~
compilation terminated.

 


Error in vl_compilenn>mex_compile (line 529)
mex(mopts{:}) ;

 

Error in vl_compilenn (line 490)
mex_compile(opts, srcs{i}, objfile, flags.mexcc) ; 

A41. You can find this file in your own system. Just copy this file to corresponding folders. It will be ok. 

 

42. /usr/bin/ld: cannot find -ljpeg

Error using mex
/usr/bin/ld: cannot find -ljpeg
collect2: error: ld returned 1 exit status

Error in vl_compilenn>mex_link (line 547)
mex(mopts{:}) ;

Error in vl_compilenn (line 498)
mex_link(opts, objs, mex_dir, flags.mexlink) ; 

A42. sudo apt-get install libjpeg-dev libimage-exiftool-perl 

 

43. Ubuntu 移动硬盘不能用 (link: https://www.cnblogs.com/lllcccddd/p/10906872.html)

A43. 

1. 在终端输入如下命令,查看分区挂载情况

sudo fdisk -l 

    最末尾/dev/sdb1 就是出问题的硬盘

2. 修复挂载错误的相应的分区,如提示中的/dev/sdb1,输入:

sudo ntfsfix /dev/sdb1 

Q44.  File "/home/wangxiao/Downloads/SINT-fast-rcnn-caffe-master/python/caffe/proto/caffe_pb2.py", line 5, in <module>

from google.protobuf.internal import enum_type_wrapper
ImportError: No module named google.protobuf.internal 

A44. sudo apt-get install python-protobuf 

 

Q45. from sklearn.linear_model import Ridge has no attribute 'decision_function' : 

A45. pip install scikit-image==0.20.4, then, change the 'decision_function' into 'predict': 

 

# p_x = regr_x.decision_function(box_feat)
# p_y = regr_y.decision_function(box_feat)
# p_w = regr_w.decision_function(box_feat)
# p_h = regr_h.decision_function(box_feat)

==>>

p_x = regr_x.predict([box_feat])

p_y = regr_y.predict([box_feat])

p_w = regr_w.predict([box_feat])

p_h = regr_h.predict([box_feat])

 

Also, remember to add a '[ ]' on the data, like box_feat. 

 

Q46. 

 

 

 

 

 

 

 

 

 

  

  1. pip install gpustat
  2.  
    watch --color -n1 gpustat -cpu
posted @ 2016-04-13 10:11  AHU-WangXiao  阅读(27800)  评论(0编辑  收藏  举报