The compiled executable file takes longer time when processing images in nvidia Jetson edge device

Dear Developer, I am using Nvidia Jetson64bit and Matlab 2024a. After I compiled the executable file for nvidia Jeton Orin. It takes 1 mins to start to process images although I load the model just once. It seems it loads the model every time it starts to process the images. This does not seem to be the situation with Matlab 2023b. Any idea for the scenerio?

4 Comments

I assume the "model" means deep learning model. How do you load the model in MATLAB code? Do you make it persistent, like this:
persistent net;
if isempty(net)
net = coder.loadDeepLearningNetwork('yourNetwork.mat');
end
Yes. it is one of the matlab model (Xception and inceptionV3). I did the same thing. It worked good in last year with matlab 2023b. I have a new edge device, it looks work much slower to load the model at the beginning with Matlab 2024a. Did not have a chance to test the matlab 2023b yet.
I don't see the issue on my side. Have you tried the PIL workflow like this:
hwobj = jetson('gpucoder-xaviernx-1', 'ubuntu', 'ubuntu');
cfg = coder.gpuConfig('dll');
cfg.Hardware = coder.Hardware('NVIDIA Jetson');
cfg.VerificationMode = 'PIL';
input = rand(299,299,3);
codegen -config cfg -args {input} foo
out = foo_pil(input); % you can run it multiple times to check the execution time.
function output = foo(input)
persistent net;
if isempty(net)
net = coder.loadDeepLearningNetwork('inceptionv3');
end
output = net.predict(input);
end
It works for me that it does not load the model every time you call foo_sil.
thanks. it takes more time than Matlab 2023b to process the first image (around 40 seconds vs over 1 mins). the model was retrained in Matlab 2023b. Retraining model in 2024a would help?

Sign in to comment.

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2024a

Asked:

on 8 Jul 2024

Commented:

on 12 Jul 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!