microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.49k stars 4.3k forks source link

Failed to load ONNX #3824

Open BerryJeong opened 3 years ago

BerryJeong commented 3 years ago

Hi, I'm trying to load a model saved as ONNX format in pytorch using torch.onnx.export. But, I got an error when I ran the below lines.

import cntk as C z = C.Function.load("model.onnx", device=C.device.cpu(), format=C.ModelFormat.ONNX)

RuntimeError: Failed to load model: 'Node: Unrecognized attribute: ceil_mode for operator MaxPool'

It seems CNTK(v2.7) does not recognize the ceil_mode attribute of MaxPool.

delzac commented 3 years ago

maybe try converting the onnx file to an older onnx version? cntk 2.7 only supports onnx up to a certain version.

prasanthpul commented 3 years ago

What do you want to do with the ONNX model? if you want to inference it, you should be using ONNX Runtime (https://github.com/microsoft/onnxruntime) ONNX Runtime supports all versions of ONNX files and is highly optimized for CPU and GPU.