Upgrade Caffe corresponding CUDNN to V5 above version _caffe learning

Source: Internet
Author: User
1. Configure the Environment

1. This article compiles in the windows7+vs2013 environment, CUDA version 8.0,CUDNN version 5.1

2. Cuda Download Address: https://developer.nvidia.com/cuda-toolkit,cudnn:cudnn-8.0-windows7-x64-v5.1 Download Address: https:// Developer.nvidia.com/cudnn

3. Install CUDA8.0 (required after vs2013 installation)

4. Unzip the downloaded CUDNN package and copy the files to the include, Bin, and Lib directories under the Cuda folder 2. To compile the GPU version of SSD

1. After the last compilation of successful CPU version, configure Commonsettings.props

[HTML] View plain copy <CpuOnlyBuild>false</CpuOnlyBuild> <UseCuDNN>true</UseCuDNN> <cuda Version>8.0</cudaversion> In addition, my cudaarchitecture is as follows:

[HTML] View plain copy <CudaArchitecture>compute_35,sm_35;compute_52,sm_52</CudaArchitecture>

2. Compile Libcaffe, error: Dtype expval = exp (min (in_data[index), Dtype (Kbnll_threshold)); modify Bnll_layer.cu as follows: [HTML] View plain C   opy Dtype expval = exp (min (in_data[index), Dtype (52))); Dtype (52) This side according to their own graphics card calculation ability to fill in.

3. Add all CU documents under Layers,solve and Util respectively under the CU catalogue of the works (layers except roi_pooling_layer.cu)

4. Modify BBOX_UTIL.CU, comment out all statements with thrust

5. Modify DETECTION_OUTPUT_LAYER.CU and Detection_output_layer.cpp files and comment out all regex and RV statements

[HTML] View plain copy//boost::regex exp ("\" (null|true|false|-?[ 0-9]+ (\\.[ 0-9]+)? \"");

[HTML] View plain copy//std::string RV = Boost::regex_replace (Ss.str (), exp, "$"); outfile << rv.substr (Rv.find ("["), Rv.rfind ("]")-Rv.find ("["))//<< Std::endl << "]" << Std::endl;

F. Modify DETECTION_OUTPUT_LAYER.HPP, note #include "boost/regex.hpp"

[HTML] View plain copy//#include <boost/regex.hpp>

6.caffe and CUDNN related file replacement

If the currently applied caffe corresponding CUDNN code is based on Cudnnv3 or CUDNNV4, to upgrade to CUDNNV5, you will need to update the corresponding Caffe, CUDNN_CONV_LAYER.HPP, CUDNN_LRN_LAYER.HPP, CUDNN_POOLING_LAYER.HPP, CUDNN_RELU_LAYER.HPP, CUDNN_SIGMOID_LAYER.HPP, Cudnn_softmax_ LAYER.HPP, CUDNN_TANH_LAYER.HPP, and their respective. cpp and. cu files are replaced.

7. cudnn.h file Replacement in Caffe

If the currently applied caffe corresponding CUDNN code is based on Cudnnv3 or CUDNNV4, to upgrade to CUDNNV5, you will need to replace the corresponding Caffe file in the latest official util/cudnn.hpp.

8. Compile Libcaffe, compile Caffe, compile classification.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.