KhronosGroup / NNEF-Tools

The NNEF Tools repository contains tools to generate and consume NNEF documents
https://www.khronos.org/nnef
222 stars 57 forks source link

onnx opset_version=11 support #110

Closed leehangyu closed 4 years ago

leehangyu commented 4 years ago

Hi

There was a problem converting a upsample bilinear layer before opset_version 11 in onnx,

But it had been fixed it by version 11,

I was wondering if you are planning to support onnx opset version 11

Thanks

gyenesvi commented 4 years ago

Can you please bit a bit more precise about what the problem is? Where was the problem previously? In ONNX? The ONNX to NNEF converter does support bilinear upsampling. By the way, as I see from the ONNX documentation, the upsample operator has been deprecated in opset version 10. What changed in version 11?

leehangyu commented 4 years ago

Sorry for not being specific.

Let me show you how they are different.

This shows the result of upsampling bilinear in opset_version_9 opset_version_9

This shows the result of upsampling bilinear in opset_version_10 opset_version_10

This shows the result of upsampling bilinear in opset_version_11 opset_version_11

as you can see, only opset_version_11 returns correct result.

Because of this, my model converted with opset_version_9 causes a critical difference between original and converted one.

gyenesvi commented 4 years ago

To me, this seems to be an incompatibility issue between PyTorch and ONNX (runtime). What is the problem related to NNEF? Is there any error when you try to convert it to NNEF?

leehangyu commented 4 years ago

The only version I can convert it with is opset version 11 as you can see from previous screen shots, but NNEF does not support 11.

That's why I am asking for when NNEF supports opset version 11, there was warning show that NNEF does not support opset version 11? So I am wondering If there is any problem doing it with NNEF

leehangyu commented 4 years ago

Oh, by the way I figured out I do not need to interrupt the intermediate stage unless layers have weight, since upsampling layer has no weight I do not need to change the algorithm but pass the parameters.

I am sorry I didn't know it, I thought I had to correct exact match even intermediate stages but It is not.

The only upsampling layer I need to change is upsampling bilinear in TF-LITE model.

Thank you for reply and help.