MATLAB Answers

0

Code Generation for Deep Learning Networks with ARM Compute Library_Help

Hi,
This is the code I copied from (https://in.mathworks.com/help/coder/ug/code-generation-for-deep-learning-networks-with-arm-compute-library.html). It is not executing. Giving error. Please help.
I have installed the following: I am using MATLAB 2019a (version on Windows 10 64bit) I have quadro p1000 GPU. 32 GB RAM. i7 8th Gen.
  • MATLAB Coder Interface for Deep Learning Libraries. To install the support package, select it from the MATLAB Add-Ons menu.
  • ARM Compute Library for computer vision and machine learning must be installed on the target hardware.
  • Deep Learning Toolbox™.
  • Environment variables for the compilers and libraries.
My executed Code:
r = raspi('192.168.43.48','pi','raspberry');
cfg = coder.config('exe');
cfg.TargetLang = 'C++';
dlcfg = coder.DeepLearningConfig('arm-compute');
dlcfg.ArmArchitecture = 'armv7';
dlcfg.ArmComputeVersion = '18.03';
cfg.DeepLearningConfig = dlcfg;
hw = coder.hardware('Raspberry Pi');
cfg.Hardware = hw;
buildDir = '~/remoteBuildDir';
cfg.Hardware.BuildDir = buildDir;
cfg.CustomSource = 'main.cpp';
codegen -config cfg squeezenet_raspi_predict.m -args {ones(227, 227, 3,'single')} -report
Output:
>> Untitled6
Deploying code. This may take a few minutes.
??? Unable to locate function 'squeezenet_raspi_predict'.
Code generation failed: View Error Report
Error using codegen
Error in Untitled6 (line 19)
codegen -config cfg squeezenet_raspi_predict.m -args {ones(227, 227, 3,'single')} -report

  0 Comments

Sign in to comment.

1 Answer

Answer by Sahithi Kanumarlapudi on 5 Aug 2019
 Accepted Answer

Your code seems fine and should work properly if you have the ‘MATLAB Support Package for Raspberry Pi Hardware’.
Use the code in the following link to generate code in case you don’t have the support package installed.

  1 Comment

Hi Sahithi,
As you said, I choose "Code Generation When You Do Not Have a Hardware Support Package" option. However, till step 6 (To generate code, use codegen) I have no errors. Everything executed fine and generaged the arm_compute folder on my hostcomputer. But, according to this url (https://www.mathworks.com/help/coder/ug/code-generation-using-arm-compute-library-without-a-hardware-support-package.html) I need to copy three files from host computer to ARM target hardware.
Copy these files from the host computer to the target hardware:
C++ main file that runs prediction on an input image, main_squeezenet_arm_generic.cpp
Input image, coffeemug.png
Makefile for building the executable program, makefile_squeezenet_arm_generic.mk
Synset dictionary, synsetWords.txt
But, in my case, I didn't get the makefile_squeezenet_arm_generic.mk to create executable file. Also, I didn't get synsetWords.txt.
But I got main squeezenet_predict_rtw.mk.
Please help, how to get this makefile_squeezenet_arm_generic.mk so that I can create executable on target hardware.
Thanks
Krishna

Sign in to comment.