工具/软件:
我已经使用 edgeai-yolov5 训练了一个 yolov5 模型、然后使用 edgeai-tidl-tools 对其进行编译、我注意到 param.yaml 中的输入详细信息为 type:tensor (float)、而在 Model Zoo 上提供的预编译模型中、否则类型为 tensor (uint8)、这可能是什么原因以及它在推理中有什么影响?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:
我已经使用 edgeai-yolov5 训练了一个 yolov5 模型、然后使用 edgeai-tidl-tools 对其进行编译、我注意到 param.yaml 中的输入详细信息为 type:tensor (float)、而在 Model Zoo 上提供的预编译模型中、否则类型为 tensor (uint8)、这可能是什么原因以及它在推理中有什么影响?
尊敬的 Vendanth:
出于 性能原因、TIDL 模型应使用 uint8 或 uint16 运行。 其中 int8 快 4 倍、int16 快。 浮动将正常工作、但在边缘器件上非常慢。 通常、所有器件都作为 uint8 运行、最常见的输入是图像数据。 其中此数据为 3,255,255、255,255、这很好地映射到 uint8。
如果使用 edgeai-tidl-tools 进行编译、并将 paramBits 设置为 32、则我唯一可以看到输出模型为 32 位浮点的位置(最好不要这样做)。 尝试将 paramBits 设置为 8、如果精度足够高、则您的模型将在器件上以最佳方式运行。
此致、
Chris
你好,我想出了问题
if models_configs[model_name]["session"]["input_optimization"] == True:
if filename[-1] == ".onnx":
print("------> Performing ONNX input optimization")
onnxOpt.tidlOnnxModelOptimize(
abs_path, abs_path, input_scale, input_mean
)