10.3. Exporting Models
This guide covers how to export trained models from Model Composer for deployment on TI microcontrollers.
10.3.1. Export Options
Model Composer provides several export formats:
Format |
Description |
|---|---|
CCS Project |
Complete Code Composer Studio project |
Artifacts Only |
Model library and headers |
ONNX Model |
Intermediate model format |
Configuration |
YAML config for CLI tools |
10.3.2. Exporting as CCS Project
The CCS Project export creates a ready-to-build project:
Step 1: Access Export
Open your trained project in Model Composer
Navigate to Export tab
Select CCS Project
Step 2: Configure Export
Select target device family
Choose SDK version (if applicable)
Select example type:
Minimal: Basic inference loop
Full: With ADC, GPIO examples
Step 3: Download
Click Export
Wait for packaging
Download ZIP file
Step 4: Import to CCS
Open Code Composer Studio
File → Import → CCS Projects
Select archive file (the ZIP)
Click Finish
Project Contents:
MyProject_CCS/
├── .project # CCS project file
├── .cproject # CCS configuration
├── main.c # Application entry
├── model/
│ ├── mod.a # Compiled model
│ ├── mod.h # Model interface
│ └── model_config.h # Configuration
├── features/
│ ├── feature_extraction.c
│ └── feature_extraction.h
├── device/
│ └── device_config.c # Device-specific init
└── linker.cmd # Memory layout
10.3.3. Exporting Artifacts Only
For integration into existing projects:
Step 1: Select Artifacts Only
Go to Export tab
Select Artifacts Only
Step 2: Choose Components
Select which files to include:
Model library (mod.a) - Required
Model header (mod.h) - Required
Feature extraction code - Recommended
Test vectors - Optional
Configuration header - Optional
Step 3: Download
Click Export
Download ZIP
Artifact Contents:
artifacts/
├── mod.a # Model library
├── mod.h # Interface header
├── model_config.h # Model parameters
├── feature_extraction.c # Feature code
├── feature_extraction.h # Feature header
└── test_vectors/ # (if selected)
├── input_0.csv
└── expected_0.csv
Using Artifacts:
Copy to your existing CCS project
Add include paths for headers
Add library to linker settings
Call model functions from your code
10.3.4. Exporting ONNX Model
For custom deployment or analysis:
Step 1: Select ONNX
Go to Export tab
Select ONNX Model
Step 2: Choose Options
Float32 model: Original precision
Quantized model: INT8 quantized
Both: Download both versions
Step 3: Download
Receive ONNX file(s):
onnx_export/
├── model_float32.onnx # Full precision
└── model_int8.onnx # Quantized
Using ONNX:
Visualize with Netron
Run inference with ONNX Runtime
Custom compilation pipelines
Cross-platform deployment
10.3.5. Exporting Configuration
Export YAML config for CLI tools:
Step 1: Select Configuration
Go to Export tab
Select Configuration (YAML)
Step 2: Download
Receive config file:
# Exported from Model Composer
common:
task_type: 'generic_timeseries_classification'
target_device: 'F28P55'
run_name: 'arc_fault_v1'
dataset:
dataset_name: 'dc_arc_fault_example_dsk'
input_data_path: '/path/to/dataset'
data_processing_feature_extraction:
feature_extraction_name: 'FFT1024Input_256Feature_1Frame_Full_Bandwidth'
variables: 1
training:
model_name: 'ArcFault_model_400_t'
training_epochs: 30
batch_size: 256
quantization: 2
quantization_method: 'QAT'
quantization_weight_bitwidth: 8
quantization_activation_bitwidth: 8
testing:
enable: True
compilation:
enable: True
Using Configuration:
cd tinyml-modelzoo
./run_tinyml_modelzoo.sh exported_config.yaml
cd tinyml-modelzoo
run_tinyml_modelzoo.bat exported_config.yaml
10.3.6. Batch Export
Export multiple projects at once:
Select projects in dashboard (checkbox)
Click Batch Export
Choose export format
Download combined ZIP
10.3.7. Export History
Track all exports:
Go to Project → History
View Exports tab
Re-download previous exports
Compare export configurations
10.3.8. Validating Exports
After exporting, validate the model:
Check Model Files:
# Verify library exists
ls -la mod.a
# Check header content
head mod.h
Test Vectors:
If test vectors were exported:
// In your test code
#include "test_vectors.h"
void validate_model(void) {
float output[NUM_CLASSES];
// Run inference on test vector
mod_inference(test_input_0, output);
// Compare with expected
for (int i = 0; i < NUM_CLASSES; i++) {
float diff = fabs(output[i] - expected_output_0[i]);
if (diff > 0.01) {
// Unexpected difference
printf("Mismatch at %d: %.4f vs %.4f\n",
i, output[i], expected_output_0[i]);
}
}
}
10.3.9. Export Troubleshooting
Export Button Grayed Out:
Training must complete first
Check for compilation errors
Refresh the page
Download Fails:
Check browser popup blocker
Try different browser
Check internet connection
CCS Import Fails:
Verify CCS version compatibility
Check SDK installation
Try “Artifacts Only” instead
Model Doesn’t Work on Device:
Verify target device matches
Check memory constraints
Validate with test vectors
10.3.10. Best Practices
Before Export:
Verify training completed successfully
Check accuracy meets requirements
Test on holdout data
Document configuration
Export Selection:
New to CCS: Use CCS Project export
Existing project: Use Artifacts Only
Custom pipeline: Use ONNX
Reproducibility: Export Configuration
After Export:
Validate model files
Test with known inputs
Profile on target device
Document performance
10.3.11. Next Steps
After exporting:
CCS Integration Guide - Import into CCS
NPU Device Deployment - NPU deployment
Non-NPU Deployment - CPU deployment