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..
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)
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.
Most helpful comment
@hasw7569 , which version of
flatbufferspackage are you using?Builder.Finish() supports
file_identifierargument from>=v1.12.0.cite:
v1.12.0
v1.11.0