MatConvnet platform is MATLAB toolbox for convolutional neural network implementation. It supports the efficient computation CPU and GPU, allowing complex models trained on large data sets. By installing MatConvnet toolbox, we can achieve deep learning algorithms to provide effective support for researchers in the Matlab platform.
MatConvnet need to compile the appropriate C / C ++ compiler, this version is installed on the GPU MatConvnet based on the MATLAB R2017b, VS 2017 and cuda 9.2. This step involves the flexibility to build their own version of the software. Provided compiled at the end of the article MatConvNet (GPU version) download link.
1, MatConvnet download
Baidu Cloud Download: matconvnet-1.0-beta25.tar
Create a folder in a file named matconvnet matlab directory, extract matconvnet-1.0-beta25.tar. My directory D: \ MATLAB \ matconvnet \ matconvnet-1.0-beta25
2, enter the command console in Matlab
mex -setup
mex -setup C++
addpath matlab
vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc', ...
'cudaRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2', ...
'enableCudnn', true, 'cudnnRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2')
3, the test
Console input: vl_testnn
Appears on the map screen, the installation is successful.
4. Problems during compilation
Question (1): 'cl.exe' is not an internal or external command, operable program or batch file
Solution: to C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ VC \ Tools \ MSVC \ 14.14.26428 \ bin
Added to the system environment variables.
问题(2):#error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
Solution: Open the file path C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v9.2 \ include \ host_cofig.h crt file in,
The row #if _MSC_VER 131 <1600 || _MSC_VER> 1911, to #if _MSC_VER <1600 || _MSC_VER> 1920. Digital versions higher than you.
Question (3): Can not find the appropriate header files, such as the emergence fatal error C1083: Can not open include file: "corecrt.h": No such file or director
Error vl_compilenn (line 487)
nvcc_compile(opts, srcs{i}, objfile, flags) ;
Solution:
It should be a configuration problem vs. Add the environment variable, there are still problems, more convenient method, the appropriate header files \ 10 \ Include \ Windows Kits 10.0.17134.0 to copy from the following directory:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include
Question (4): After successfully compile and run the code appears when
Try SCRIPT vl_nnconv as a function of execution ...
Error vl_simplenn (line 300)
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, ...
Solution:
Before matlab software runs every time you start the program, install it toolbox. Run \ matconvnet-1.0-beta25 \ matlab \ vl_setupnn.m files that run vl_setupnn.m input in the console.
5, compiled MatConvNet (GPU version) Download
Download link: matconvnet-1.0-beta25 (GPU compiled)