This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Prerequisites for Deep Learning with MATLAB Coder

MathWorks Products

To use MATLAB® Coder™ to generate code for deep learning networks, you must also install:

  • Deep Learning Toolbox™

  • MATLAB Coder Interface for Deep Learning Libraries

Third-Party Hardware and Software

You can use MATLAB Coder to generate C++ code for deep learning networks that you deploy to Intel® or ARM® processors. The generated code takes advantage of deep learning libraries optimized for the target CPU. The hardware and software requirements depend on the target platform.

 Intel CPUsARM CPUs
Hardware Requirements

Intel processor with support for Intel Advanced Vector Extensions 2 (Intel AVX2) instructions.

ARM Cortex-A processors that support the NEON extension.

Software Libraries

Intel Math Kernel Library for Deep Neural Networks, v0.13(Intel MKL-DNN).

ARM Compute Library for computer vision and machine learning, v18.03

Operating System Support

Windows® and Linux® only.

Windows and Linux only.

C++ Compiler

MATLAB Coder locates and uses a supported installed compiler. For the list of supported compilers, see Supported and Compatible Compilers on the MathWorks® website.

On Windows, code generation for deep learning networks by using the codegen command requires Microsoft® Visual Studio® 2015 or later.

You can use mex -setup to change the default compiler. See Change Default Compiler (MATLAB).

Other

Open Source Computer Vision Library (OpenCV), v3.1.0 is required for some deep learning examples.

Note: The examples require separate libraries such as opencv_core.lib and opencv_video.lib. The OpenCV library that ships with Computer Vision System Toolbox™ does not have the required libraries and the OpenCV installer does not install them. Therefore, you must download the OpenCV source and build the libraries.

For more information, refer to the OpenCV documentation.

Environment Variables

MATLAB Coder uses environment variables to locate the libraries required to generate code for deep learning networks.

PlatformVariable NameDefault ValueDescription
Windows INTEL_MKLDNNC:\Program Files\mkl-dnn

Path to the root folder of the Intel MKL-DNN library installation.

ARM_COMPUTELIB/usr/local/arm_compute

Path to the root folder of the ARM Compute Library installation on the ARM target hardware.

OPENCV_DIRC:\Program Files\opencv\build

Path to the build folder of OpenCV. This variable is required for building deep learning examples.

PATHC:\Program Files\mkl-dnn\bin

Path to the Intel MKL-DNN library folder.

C:\Program Files\opencv\build\x64\vc15\bin

Path to the dynamic-link libraries (DLL) of OpenCV. This variable is required for running deep learning examples.

Linux PATH/usr/lib/

Path to the OpenCV libraries. This variable is required for building and running deep learning examples.

/usr/include/opencv

Path to the OpenCV header files. This variable is required for building deep learning examples.

LD_LIBRARY_PATH/usr/local/mkl-dnn/lib/

Path to the Intel MKL-DNN library folder.

INTEL_MKLDNN/usr/local/mkl-dnn/

Path to the root folder of the Intel MKL-DNN library installation.

ARM_COMPUTELIB/usr/local/arm_compute/

Path to the root folder of the ARM Compute Library installation on the ARM target hardware.

Related Topics