Use MATLAB to Train on Jetson Nano: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Evrard.leuteu-feukeu@stud.hshl.de (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Evrard.leuteu-feukeu@stud.hshl.de (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 39: Zeile 39:
| 1 || Access GPU APP || Matlab provides built-in app to generate Cuda compatible code.|| [[Datei:Gpu coder APP.png|mini]]
| 1 || Access GPU APP || Matlab provides built-in app to generate Cuda compatible code.|| [[Datei:Gpu coder APP.png|mini]]
|-  
|-  
| 2 || Select Entry-Point Function|| For Cuda code to be successfully generated, Matlab script must be a function  ||  
| 2 || Select Entry-Point Function|| For CUDA code to be successfully generated, the MATLAB script must be a function. Hence, your script needs to be converted to a function. ||  
[[Datei:Gpu coder function.png|mini]]
[[Datei:Gpu coder function.png|mini]]
|-  
|-  
Zeile 46: Zeile 46:


|-  
|-  
| 4 || Select Targeted GPU|| The Cuda code can be Generated directly on the chosen device or generated on the main pc and manually transported on the device ||  
| 4 || Select Targeted GPU|| The CUDA code can be Generated directly on the chosen device or generated on the main pc and manually transported on the device ||  


|-  
|-  

Version vom 2. Juni 2025, 15:44 Uhr

Setup

Overview

To train the AI using MATLAB, I will write a script on MATLAB and then use GPU Coder to flash the function/model on the JetRacer. So all the debugging process will be on MATLAB.

Key Concepts

  • Deep Learning with MATLAB
  1. The fundamental of training an AI system is called deep learning. MATLAB provides a variety of helpful toolboxes, pre-trained networks, and tools to process data into useful input for an AI [1].
  2. The training can be stored as a model, usually in a .MAT format, which can be reused. Hence, we do not have to train a model every time we want to use it.
  3. Data preprocessing—including image resizing, augmentation, and normalization—is handled with MATLAB functions such as imageDatastore and augmentedImageDatastore.
Tabelle 4: Deep Learning with MATLAB Setup
# Description Pictures
1 Data Processing
  • image resizing:
  • augmentation:
  • normalization:
2 Model training
3 Output


  • Gpu Coder
  1. GPU Coder generates optimized CUDA® C++ from your MATLAB® algorithms, unlocking the parallel compute power of the Jetson GPU for real-time processing on your JetRacer and improve 40 times the performance on the jetracer [2][3].
  2. Helps target GPUs for automotive applications.
Tabelle 4: GPU Coder Setup
# Description Pictures
1 Access GPU APP Matlab provides built-in app to generate Cuda compatible code.
2 Select Entry-Point Function For CUDA code to be successfully generated, the MATLAB script must be a function. Hence, your script needs to be converted to a function.
3 Select Input types A second file is required for the GPU Coder to Know what asre the inputs and Outputs
4 Select Targeted GPU The CUDA code can be Generated directly on the chosen device or generated on the main pc and manually transported on the device
5 Generate c/c++


Result

generated files