Skip to content

Attempting to add a duplicate function when exporting to TF Lite #41

@monatis

Description

@monatis

I want to deploy Conformer Subwords model on RPi for a PoC work. When exporting the latest pretrained model with tflite_subword_conformer.py and tf-nightly v2.5.0.dev20201106, I'm getting the following exception. Anyone getting the same?

  File "tflite_subword_conformer.py", line 70, in <module>
    tflite_model = converter.convert()
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\lite\python\lite.py", line 1118, in convert
    return super(TFLiteConverterV2, self).convert()
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\lite\python\lite.py", line 922, in convert
    self._funcs[0], lower_control_flow=False))
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\framework\convert_to_constants.py", line 1111, in convert_variables_to_constants_v2_as_graph
    converted_input_indices)
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\framework\convert_to_constants.py", line 1003, in _construct_concrete_function
    new_output_names)
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\eager\wrap_function.py", line 650, in function_from_graph_def
    wrapped_import = wrap_function(_imports_graph_def, [])
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\eager\wrap_function.py", line 630, in wrap_function
    signature=signature)
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\eager\wrap_function.py", line 229, in __init__
    context.context().add_function_def(f)
  File "D:\coding\asr\examples\conformer\env\lib\site-packages\tensorflow\python\eager\context.py", line 1138, in add_function_def
    len(fdef_string))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Attempting to add a duplicate function with name: __inference_standard_lstm_20496 where the previous and current definitions differ. Previous definiton: signature {
...
}

Please note that I omited the signature definition for brevity, but I can post it separately if it matters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions