ONNC/onnc

Your model ir_version is higher than the checker's.

Opened this issue · 3 comments

ccshi commented

I meet the following questin when i exacute :
"onnc/bin/onnc torchalex/alexnet.onnx -mquadruple nvdla"

Your model ir_version is higher than the checker's.
ONNXShapeInference pass is not workable!!
Your model ir_version is higher than the checker's.
ONNXShapeInference pass is not workable!!
createTensor error: unknow elemtype = 0
Segmentation fault (core dumped)

Currently, we use ONNX v1.3, it's ir_version is 3. And your model comes from a higher version ONNX.
You can upgrade the ONNX that ONNC used. It may require some modification.

It is a bit of a hack, but if the ops used by your model were available in ONNX v1.3 / ir_version 3, you may be able get your model running by lowering its ir_version.

For instance, using the Python onnx package:

import onnx
from onnx import version_converter

target_version = 8
ir_version     = 3

model_path     = './model.onnx'
original_model = onnx.load(model_path)

converted_model = version_converter.convert_version(original_model , target_version)
converted_model.ir_version = ir_version

onnx.save(converted_model, model_path)

Hi @robinvanemden ...im getting this error if i use the code u mentioned

IndexError: invalid unordered_map<K, T> key in the line
converted_model = version_converter.convert_version(original_model , target_version)