pytorch转onnx问题
时间:2019-09-18 18:20:00
收藏:0
阅读:1073
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)
原文:https://www.cnblogs.com/haiyang21/p/11543951.html
评论(0)