Comments (1)
作者你好,我有一个问题,是关于把pse算法的onnx模型转换到pb模型,遇到的一个问题:
**Traceback (most recent call last):
File "/home/fffan/fffan_files/Experiment/Example/onnx2pb/onnx2pb.py", line 45, in
onnx2pb_2(onnx_input_path)
File "/home/fffan/fffan_files/Experiment/Example/onnx2pb/onnx2pb.py", line 14, in onnx2pb_2
tf_rep = prepare(model)
File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/backend.py", line 65, in prepare
return cls.onnx_model_to_tensorflow_rep(model, strict)
File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/backend.py", line 85, in onnx_model_to_tensorflow_rep
return cls._onnx_graph_to_tensorflow_rep(model.graph, opset_import, strict)
File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/backend.py", line 146, in _onnx_graph_to_tensorflow_rep
strict=strict)
File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/backend.py", line 241, in _onnx_node_to_tensorflow_op
return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/handlers/handler.py", line 60, in handle
cls.args_check(node, kwargs) File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/handlers/backend/resize.py", line 89, in args_check "Tensorflow") File "/home/fffan/下载/onnx-tensorflow-tf-1.x/onnx_tf/common/exception.py", line 50, in call raise self._func(self.get_message(op, framework)) RuntimeError: Resize coordinate_transformation_mode=pytorch_half_pixel is not supported in Tensorflow.
我没看到载pytorch有关pytorch_half_pixel这个的使用,但是转换模型的时候总是这个错。请问作者能不能解决这个问题?
非常期待作者的回复。
这个问题是在F.interpolate里面出现的。因为在不同框架中上采样的具体中,随着采样点的选择不同导致结果不同。在torch转onnx的过程中,nearest的采样方式被定义为asymmetric,bilinear中有一个align_corners的参数,设置为false的时候会被定义为pytorch_half_pixel,true的时候则为align_corners采样方式。
这个定义你可以在torch->onnx->opset11算子定义的那个文件里面找到。
解决方法可以是将onnx对应节点用mode=align_corners的bilinear操作代替,不过这样就会损失精度。
from tensorrt.
Related Issues (20)
- 请教关于pytorch-yolov3-onnx-tensorRT加速问题 HOT 1
- 编译问题 HOT 2
- 多线程问题 HOT 1
- run yolov5 failed HOT 1
- yolov5s int8量化不出框? HOT 5
- 这是一个非常好的项目, 但是https://github.com/Syencil/tensorflow-yolov3没有了,能否重新上传您的项目呢,我使用原版代码无法完成.pb到.onnx的转换 HOT 5
- resnet infer编译有问题,代码继承那可能需要改下 HOT 1
- tensorRT6.0有问题 HOT 1
- Psnet onnx转trt咨询 HOT 1
- 最后的trt可以被编译成so吗? HOT 1
- Serializing Engine Failed
- pytorch 模型的输入格式为B,C,H,W,而opencv读入的图片为H,W,C,请问是C++是怎么将H,W,C转为C,H,W格式的?类似于numpy.transpose的功能 HOT 3
- 请问yolov5的版本是多少的,v4.0的么 HOT 1
- are you available? HOT 2
- 编译错误:/usr/bin/ld: cannot find -lfcostrt HOT 2
- YOLOv5 parse problem HOT 1
- 再实际中trt也不存在理想上的动态输入?trt不是支持动态输入阿,像psenet的话肯定需要动态输入阿 HOT 1
- yolov5s 检测不出框 HOT 2
- yolov5 run error:Found unsupported datatype (11) when importing initializer: model.0.conv.total_ops
- /usr/bin/ld: 找不到 -lyolov5trt
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 tensorrt.