Comments (8)
像这种就能成功pytorch->onnx->tensorRT,截取的区间不要是最后一个维度。同时在pytorch->onnx的过程中最好不要使用像[:,0:2,:]的操作,除了batch,最好每个维度都给出确定的数字。希望能帮到同样像导出tensorRT的人。
from ultra-light-fast-generic-face-detector-1mb.
@saladjay tensorRt没怎么用过,不过你说的这部分属于后处理代码部分,数学算子比较多一点,各个框架之间算子转换兼容性比较容易出问题。其实你可以在导出onnx的时候注释掉ssd.py中调用convert_locations_to_boxes()和center_form_to_corner_form()这两处,应该是第95~98行,让推理框架只负责提取特征,输出上面boxes偏移量就好,框解码部分的后处理代码可以用c++写,不是很复杂,可控速度也不慢优化程度高。而且推理框架处理这段可能效果反而不太好,不太可控。
from ultra-light-fast-generic-face-detector-1mb.
一般情况下,ONNX导入到TensorRT报这个错误,是因为pytorch使用了view层。但是我去看代码,没有找出view层在哪里。
from ultra-light-fast-generic-face-detector-1mb.
compute_header里有view,你可以用onnx-simplifier 生成精简onnx试下。
from ultra-light-fast-generic-face-detector-1mb.
我解决上面那个的问题,在compute_header中使用view(int(num1),num2)这种方式解决。
接下来slice操作报错了。slice对应pytorch的tensor取区间操作。我反复查看了pytorch的代码,没发现越界的问题。不知道怎么解决。
from ultra-light-fast-generic-face-detector-1mb.
from ultra-light-fast-generic-face-detector-1mb.
像这种就能成功pytorch->onnx->tensorRT,截取的区间不要是最后一个维度。同时在pytorch->onnx的过程中最好不要使用像[:,0:2,:]的操作,除了batch,最好每个维度都给出确定的数字。希望能帮到同样像导出tensorRT的人。
遇到一样的问题。
In node 76 (convert_axis): UNSUPPORTED_NODE: Assertion failed: axis >= 0 && axis < nbDims
能详细讲一下怎么转tensorrt模型吗?
from ultra-light-fast-generic-face-detector-1mb.
像这种就能成功pytorch->onnx->tensorRT,截取的区间不要是最后一个维度。同时在pytorch->onnx的过程中最好不要使用像[:,0:2,:]的操作,除了batch,最好每个维度都给出确定的数字。希望能帮到同样像导出tensorRT的人。
遇到一样的问题。
In node 76 (convert_axis): UNSUPPORTED_NODE: Assertion failed: axis >= 0 && axis < nbDims能详细讲一下怎么转tensorrt模型吗?
view改flatten或者view的第一个参数强制转换为int类型
from ultra-light-fast-generic-face-detector-1mb.
Related Issues (20)
- How to increase amount of using CPUs?
- 请问可以批量推理吗
- About the BBox Detection for "masked-Face"
- ModuleNotFoundError: No module named 'vision'
- error building for ncnn
- 请问README中的测试精度是指什么?
- Error while training HOT 1
- Bounding box overlap issue.
- Min_boxes (anchors) calculation
- 请问如何训练灰度图? HOT 1
- ModuleNotFoundError: No module named 'tf' in convert_tensorflow.py HOT 1
- converting to tfjs model
- onnx转换出来报错
- Transfer learning and lable output
- 对全景图进行人脸识别
- 有一段代码不是很理解,有哪位大佬帮我解下惑 HOT 1
- 代码参数理解 HOT 1
- Improve accuracy of the ultraface-rfb-640.onnx model
- 如何优化GPU训练速度
- 大哥你也太强了, 啥都会啊, 这代码没注释根本看不懂
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultra-light-fast-generic-face-detector-1mb.