ONNC / onnc

Open Neural Network Compiler
https://onnc.ai
BSD 3-Clause "New" or "Revised" License
514 stars 92 forks source link

Your model ir_version is higher than the checker's. #160

Open ccshi opened 5 years ago

ccshi commented 5 years ago

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)

a127a127 commented 5 years ago

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.

robinvanemden commented 4 years ago

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)
padmasreenagarajan commented 4 years ago

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)