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

NNEF Reference Results #146

Closed hansely closed 3 years ago

hansely commented 3 years ago

Hi I am trying to compare the correctness of certain models. Does NNEF offer a runtime functionality where I can get the reference results for certain models? Or does it always has to be converted to some other frameworks(pytorch/caffe/onnx) to run the inference and get the reference results? If you guys can offer a reference result for the correctness purposes, that would be great.

gyenesvi commented 3 years ago

Yes, there are two ways to do that. If you need C++ code (CPU only), you can use the API here:

https://github.com/KhronosGroup/NNEF-Tools/blob/master/parser/cpp/include/nnef.h

Load the graph, and then use the execute function.

You can also use the nnef_tools.execute command-line tool, here:

https://github.com/KhronosGroup/NNEF-Tools/blob/master/nnef_tools/execute.py

This one executes an NNEF model using PyTorch. See the readme for more details:

https://github.com/KhronosGroup/NNEF-Tools/tree/master/nnef_tools#executing-a-model-and-saving-activations

hansely commented 3 years ago

Thanks for the info! I will close the issue now.