Onnx: model checker core dump

Created on 5 Nov 2019  路  2Comments  路  Source: onnx/onnx

I tried this code:

import torch
import torchvision

import onnx

model = torchvision.models.resnet18()
dummy_input = torch.randn(1, 3, 300, 300)
torch.onnx.export(model, dummy_input, './play.onnx', opset_version=11)

model = onnx.load('./play.onnx')
onnx.checker.check_model(model)

My onnx version is 1.6 installed with python -m pip install onnx, and my pytorch version is 1.3 installed with conda install -c pytorch pytorch.

Please tell me why there is core dump here, and how could I make it work?

Most helpful comment

I did not look closer at the cause of this error, but I solved it by importing onnx before importing torch:

import onnx
import torch

All 2 comments

there has any advise? I met the same issue... but I just follow the tutorials
https://pytorch.org/tutorials/advanced/super_resolution_with_onnxruntime.html

I did not look closer at the cause of this error, but I solved it by importing onnx before importing torch:

import onnx
import torch
Was this page helpful?
0 / 5 - 0 ratings