-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ONNX模型导入到TensorRT报错。 #26
Comments
一般情况下,ONNX导入到TensorRT报这个错误,是因为pytorch使用了view层。但是我去看代码,没有找出view层在哪里。 |
compute_header里有view,你可以用onnx-simplifier 生成精简onnx试下。 |
@saladjay tensorRt没怎么用过,不过你说的这部分属于后处理代码部分,数学算子比较多一点,各个框架之间算子转换兼容性比较容易出问题。其实你可以在导出onnx的时候注释掉ssd.py中调用convert_locations_to_boxes()和center_form_to_corner_form()这两处,应该是第95~98行,让推理框架只负责提取特征,输出上面boxes偏移量就好,框解码部分的后处理代码可以用c++写,不是很复杂,可控速度也不慢优化程度高。而且推理框架处理这段可能效果反而不太好,不太可控。 |
view改flatten或者view的第一个参数强制转换为int类型 |
模型是Mb_Tiny_RFB_FD_train_input_640.pth
The text was updated successfully, but these errors were encountered: