Skip to content

[freeze_graph] tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef expected inputs '' do not match 1 inputs specified; Op<name=Const; signature= -> output:dtype; attr=value:tensor; attr=dtype:type>; NodeDef: bidirectional_1/while/add/y = Const[dtype=DT_INT32, value=Tensor<type: int32 shape: [] values: 1>](bidirectional_1/while/Switch:1) #2

@mdztravelling

Description

@mdztravelling

When I try to freeze TF graph that uses tf.keras layers I get the following exception.

Traceback (most recent call last):
File "/home/ssd1/work/test/melodyExtraction_JDC/python36/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 418, in import_graph_def
graph._c_graph, serialized, options) # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef expected inputs '' do not match 1 inputs specified; Op<name=Const; signature= -> output:dtype; attr=value:tensor; attr=dtype:type>; NodeDef: bidirectional_1/while/add/y = Constdtype=DT_INT32, value=Tensor<type: int32 shape: [] values: 1>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "keras_to_frozen.py", line 111, in
infer(out_filename, input_data)
File "keras_to_frozen.py", line 86, in infer
graph = tf.import_graph_def(graph_def, name="")
File "/home/ssd1/work/test/melodyExtraction_JDC/python36/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "/home/ssd1/work/test/melodyExtraction_JDC/python36/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 422, in import_graph_def
raise ValueError(str(e))
ValueError: NodeDef expected inputs '' do not match 1 inputs specified; Op<name=Const; signature= -> output:dtype; attr=value:tensor; attr=dtype:type>; NodeDef: bidirectional_1/while/add/y = Constdtype=DT_INT32, value=Tensor<type: int32 shape: [] values: 1>

how to resove this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions