-
Notifications
You must be signed in to change notification settings - Fork 378
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
import order cause core dump #32
Comments
Thanks for your report!
I think it might be related to torch and onnx themselves, but not to
onnxsim. Could you please check if it occurs due to the import of onnxsim?
Allen Ling <notifications@github.com> 于 2019年11月16日周六 上午11:47写道:
… pytorch1.3.0, onnx1.6.0, onnxsim0.2.0
a simple test case
import torch
import onnx # type: ignore
import onnxsim
def main():
class TestNet(torch.nn.Module):
def __init__(self):
super(TestNet, self).__init__()
self.conv = torch.nn.Conv1d(2, 3, kernel_size=(1,))
return
def forward(self, x):
res = self.conv(x)
return res
net = TestNet()
it = torch.randn(1, 2, 3)
torch.onnx.export(net, it, "test_sim.onnx", export_params=True, verbose=True, input_names=["data"])
model_opt = onnxsim.simplify(
"test_sim.onnx"
)
print("export done")
onnx.save(model_opt, "test_sim_simple.onnx")
print("Ok!")
if __name__ == '__main__':
main()
outputs
graph(%data : Float(1, 2, 3),
%conv.weight : Float(3, 2, 1),
%conv.bias : Float(3)):
%3 : Float(1, 3, 3) = onnx::Conv[dilations=[1], group=1, kernel_shape=[1], pads=[0, 0], strides=[1]](%data, %conv.weight, %conv.bias), scope: TestNet/Conv1d[conv] # /usr/local/lib/python3.5/dist-packages/torch/nn/modules/conv.py:202:0
return (%3)
Segmentation fault (core dumped)
but it works after i import torch after onnx
import torch
import onnx # type: ignore
import onnxsim
change to
import onnx # type: ignore
# import torch after onnx
import torch
import onnxsim
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#32?email_source=notifications&email_token=ACYRZH6LESJ3V6ESM5772GLQT5UNXA5CNFSM4JODIVC2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZYKMRA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYRZHZ7KPJXVFHT3HLFRT3QT5UNXANCNFSM4JODIVCQ>
.
|
onnx.checker.check_model fail
guess it is a bug in torch/onnx, onnxsim is clean...
core dump without onnxsim |
issue in onnx onnx/onnx#2431 |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pytorch1.3.0, onnx1.6.0, onnxsim0.2.0
a simple test case
outputs
but it works after i import torch after onnx
change to
The text was updated successfully, but these errors were encountered: