One: [tflitefile_tool] occured "select_operator.py" error.

Created on 12 Aug 2020  路  4Comments  路  Source: Samsung/ONE

Hi,

I was using select_operator.py script to split tflite model.

but it didn't work well and I don't know what is the problem.

I just used this command ./tools/tflitefile_tool/select_operator.py model/posenet1.tflite input out.tflite

and I got this error message
Input tensor(s): [0, 4, 8] Output tensor(s): [1, 5, 10] Append subgraphs, old index : 0 , new index : 0 Traceback (most recent call last): File "./tools/tflitefile_tool/select_operator.py", line 1359, in <module> main(args) File "./tools/tflitefile_tool/select_operator.py", line 1329, in main new_builder.Finish(new_model, file_identifier=b'TFL3') TypeError: Finish() got an unexpected keyword argument 'file_identifier'

Please let me know what's wrong..

help wanted

Most helpful comment

@hasw7569 , which version of flatbuffers package are you using?

Builder.Finish() supports file_identifier argument from >=v1.12.0.

cite:
v1.12.0


def Finish(self, rootTable, file_identifier=None):
        """Finish finalizes a buffer, pointing to the given `rootTable`."""
        return self.__Finish(rootTable, False, file_identifier=file_identifier)

v1.11.0


def Finish(self, rootTable):
        """Finish finalizes a buffer, pointing to the given `rootTable`."""
        return self.__Finish(rootTable, False)

All 4 comments

Traceback (most recent call last):
File "./tools/tflitefile_tool/select_operator.py", line 1359, in <module>
main(args)
File "./tools/tflitefile_tool/select_operator.py", line 1329, in main
new_builder.Finish(new_model, file_identifier=b'TFL3')
TypeError: Finish() got an unexpected keyword argument 'file_identifier'

@hasw7569 , which version of flatbuffers package are you using?

Builder.Finish() supports file_identifier argument from >=v1.12.0.

cite:
v1.12.0


def Finish(self, rootTable, file_identifier=None):
        """Finish finalizes a buffer, pointing to the given `rootTable`."""
        return self.__Finish(rootTable, False, file_identifier=file_identifier)

v1.11.0


def Finish(self, rootTable):
        """Finish finalizes a buffer, pointing to the given `rootTable`."""
        return self.__Finish(rootTable, False)

@hasw7569 It occurs because I changed select_operator.py to use v1.12.0's Finish instead of our custom Finish. Could you please update flatbuffer by pip install -U flatbuffers?

Thank you all : )
It solved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

periannath picture periannath  路  3Comments

periannath picture periannath  路  3Comments

mhs4670go picture mhs4670go  路  3Comments

jinevening picture jinevening  路  3Comments

mhs4670go picture mhs4670go  路  4Comments