基于AM67A的嵌入式语音识别功能实现(三):虚拟机端编译及验证

虚拟机端编译及验证

方案一:.prototxt 配置方式 早期 TIDL SDK 中旧式方法

1.增加asr_model.prototxt文件和将 asr_model.onnx文件放置到对应位置

# 目录图
edgeai-tidl-tools/
├── models/
│   └── onnx/
│       └── asr_model.onnx
└── examples/
    └── models/
        └── prototxt/
            └── asr_model.prototxt
# asr_model.prototxt
modelType              = 1                         # ONNX模型
numParamBits           = 8                         # 8-bit量化
quantizationStyle      = 2                         # 2 = 训练后量化 (Post-Training Quantization)

inputNetFile           = "../../models/onnx/asr_model.onnx"          # 你的ONNX模型路径
outputNetFile          = "asr_model.bin"
outputParamsFile       = "asr_model.params"

inDataNamesList        = spec
outDataNamesList       = logits

inputDimensions        = 1, 1, 161, 200            # 固定输入shape: [NCHW]
numChannels            = 1                         # C=1
numRows                = 161                       # H
numCols                = 200                       # W

preprocType            = 0                         # 不做图像预处理
metaDataFile           = meta_data.bin             # 可留空,或者你生成一个量化校准文件(用于量化校准)

2.进入 TIDL 主目录执行:

cd edgeai-tidl-tools
./tools/tidl_model_import.out ./examples/models/prototxt/asr_model.prototxt

注意:执行后可能会遇到 modelType 参数重复和device_config.cfg 找不到 的问题,默认寻找路径是…/…/test/testvecs/config/import/,实际存在路径为./device_config.cfg,更改路径或复制到默认路径

方案二:YAML 模板导入流程 官方 edgeai-tidl-tools 的标准方法,新版本 SDK 更鼓励使用 YAML + run_import_on_pc.py

1.找到已有示例模板 run_import_on_pc.py

cd ~/edgeai-tidl-tools/examples/osrt_python

2.准备model_list.yaml 文件

examples/osrt_python/model_list/ 文件夹下,每一个 YAML 对应一个模型的导入配置。

🔧复制一个现有的配置(例如 mobilenet_v2.yaml):

cp model_list/mobilenet_v2.yaml model_list/asr_model.yaml

并修改如下关键字段:

model_path: ../../models/onnx/asr_model.onnx
input_data_path: ../../test_data/input/your_input_file  # 可以随便写一个虚拟路径
preprocess:
  mean: [0.0]
  scale: [1.0]
  chann
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值