tensorflow - TensorRT 如何处理数据?
问题描述
在 Tensorflow 中,Tensor 格式为 NxWxHxC 并通过网络。
Tensorflow 模型转换为 TensorRT 引擎时,Tensor 数据是如何处理的。与 Thensoflow 中的形状相同或扁平。
Flattened 表示,例如 1x3x4x3 张量
[[[1,2,3],[4,5,6],[7,8,9],[10,11,12]],
[[1,2,3],[4,5,6],[7,8,9],[10,11,12]],
[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]]
被压扁成
[1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11,12]
单个数组并处理。
解决方案
TensorRT 以 NCHW 格式处理数据。当数据被展平时,它是 NCHW 格式。这意味着,数据被展平为
1,4,7,10,1,4,7,10,1,4,7,10,2,5,8,11,2,5,8,11,2,5,8,11,3,6,9,12,3,6,9,12,3,6,9,12
推荐阅读
- java - 为什么 setOnTouchListener 后另一个不起作用(Android)
- laravel - Redis 连接 [缓存] 未配置 laravel 错误
- python - 分析来自 Kafka 消费者的消息
- forms - 如何向 symfony 小部件根元素添加一个类
- javascript - 带有浮动滚动条插件的handsontable
- react-native - 将 react-navigation 更新到 v3 后 undefined 不是对象
- vue.js - 从 Axios GET 设置数据
- typescript - Vue-CLI、TypeScript 和 monorepo:如何在 /src 之外声明类型?
- node.js - req.flash 不能与 res.redirect 一起使用
- linux - 在屏幕截图中获取文本或基于文本的形状的 X/Y 位置的最快方法?