KhronosGroup / NNEF-Tools

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

Converting TfLite model to NNEF, SQUEEZE attribute error #153

Closed Legerdemainist closed 2 years ago

Legerdemainist commented 2 years ago

I am trying to convert a derivative of MobileNetV2, I have the .tflite file however when I'm trying to convert it I get the following error Could not evaluate attribute 'dtype' while converting operator 'SQUEEZE'; NameError: name 'T' is not defined This is the converter call I use python3 -m nnef_tools.convert --input-format tflite --output-format nnef --input-model model.tflite --output-model model.nnef

gyenesvi commented 2 years ago

I have pushed a fix for the converter, can you try again now and let me know if it works?

Legerdemainist commented 2 years ago

Thank you for your quick help! I grabbed the newest master and tried it, however, now the io/nnef/writer.py is giving me the following attribute error: AttributeError: module 'nnef' has no attribute 'format_version'. Probably messed something up during installation, I will report back once I resolved it

gyenesvi commented 2 years ago

It seems that your nnef package is outdated, probably from a previous install. Could you try uninstalling it from pip and running setup.py again for the nnef package (not for nnef_tools)?

Legerdemainist commented 2 years ago

Seems to be working now. Thank you for your help!