首页 > 其他 > 详细

pytorch转onnx问题

时间:2019-09-18 18:20:00      阅读:1070      评论:0      收藏:0      [点我收藏+]

 

1. RuntimeError: ONNX export failed: Couldn‘t export operator aten::rsqrt

技术分享图片

 2. RuntimeError: ONNX export failed: Couldn‘t export operator aten::reshape

原因:pytorch-1.0.1不支持reshape操作

解决:~/anaconda3/envs/py36/lib/python3.6/site-packages/torch/onnx/symbolic.py

在该文件中添加代码

def reshape(g, self, shape):
    return view(g, self, shape)


def reshape_as(g, self, other):
    shape = g.op(Shape, other)
    return reshape(g, self, shape)

 

pytorch转onnx问题

原文:https://www.cnblogs.com/haiyang21/p/11543951.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!