Neargye / hello_tf_c_api

Neural Network TensorFlow C API
MIT License
468 stars 134 forks source link

Import LSTM-Layer: Expected input[1] to be control input #58

Closed andreaslebherz closed 3 years ago

andreaslebherz commented 4 years ago

Hello!

First, thanks for providing this project - it helped me a lot with using the c_api of Tensorflow in my project. One problem I encountered happened when using load_graph.cpp to import a model containing any time-dependent layer (RNN, GRU, LSTM). The program crashes at TF_SessionRun()with the follwing contents of the status:

Expected input[1] == 'TensorArrayV2_1/element_shape:output:0' to be a control input.
    In {{node TensorArrayV2Stack/TensorListStack}}
     [[{{node test_model/lstm/PartitionedCall}}]]
     [[{{node StatefulPartitionedCall}}]]
     [[{{node StatefulPartitionedCall}}]]

Do you have any idea what that is supposed to mean? I cannot understand what is missing here since input[1] is supposed to be 0. If you or anyone else has ever encountered this or know anything about that - I'm so happy about any piece of advice since im stuck with this for way too long now.

Thanks very much for your help, for a longer describtion of what I'm trying to do I have posted this also on stackoverflow: https://stackoverflow.com/questions/64754471/tensorflow-c-api-1-13-2-import-lstm-pb-expected-input1-to-be-a-control-i