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

No shape propagator issue #96

Closed hansely closed 4 years ago

hansely commented 4 years ago

While converting a tensorflow-pb model to nnef, I encountered an issue saying

Error: No shape propagator for LeakyRelu

I used the following command for the conversion: ./nnef_tools/convert.py --input-format tensorflow-pb --output-format nnef --input-model model.pb --output-model ./output.nnef --input-shape="[1, 224, 224, 3]" --io-transformation SMART_NHWC_TO_NCHW

Does this mean that the conversion for LeakyRelu operation is not supported?

gyenesvi commented 4 years ago

It was left out accidentally, now it should be working, can you check?

hansely commented 4 years ago

Thanks, it converts fine to nnef model. However, when parsing the model with input name as

graph network(Graph/Preprocess/Input) -> (output),

I'm getting the following error: _nnef.Error: Parse error in 'graph.nnef' [3:20] expected token ')', found '/'. Does the parser not support input name with '/' in it?

gyenesvi commented 4 years ago

Of course it does not support '/' in an identifier, that is illegal in most languages since '/' is a math operator. Did you get this as the result of the conversion? I believe the converter should replace the '/' with '_'.

hansely commented 4 years ago

Yes, that is what I got by using nnef_tools/convert.py

hansely commented 4 years ago

Even if I change the input name to Graph_Preprocess_Input, it still throws a following error:

Traceback ... input_shape = graph.tensor_shapes[input_tensor.name] KeyError: 'Graph_Preprocess_Input'

Is it because the name doesn't match the original name before conversion?

gyenesvi commented 4 years ago

We have corrected the naming issue, now it should substitute illegal characters with '_'.

However, we don't find the line input_shape = graph.tensor_shapes[input_tensor.name]. Is that in the converter code? The graph object in the converters don't have a tensor_shapes attribute.

hansely commented 4 years ago

Oh that was from myself. Now it looks good to me. Thank you.