Import frozen graph of a LSTM has an error
See original GitHub issueUsing Tensorflow v1.11.0.
Please see here to reproduce the error: https://github.com/esdu/misc/blob/master/bug_report_lstm_freeze.ipynb
In the above notebook, I train a simple LSTM, try to freeze the graph, and load the frozen graph. Upon loading the frozen graph, I see an error:
InvalidArgumentError: Input 0 of node import/lstm/while/ReadVariableOp/Enter was passed float from import/lstm/kernel:0 incompatible with expected resource.
The lstm/kernel
node was frozen into a Const, and lstm/while/ReadVariableOp/Enter
cannot read it in. The same thing is observed for other variables related to the LSTM: lstm/bias
and lstm/recurrent_kernel
.
Any hints on how to freeze an LSTM trained in Keras?
Issue Analytics
- State:
- Created 5 years ago
- Comments:13
Top Results From Across the Web
Tensorflow - Unable to import frozen graph with batchnorm ...
I am trying to freeze in a pbtxt file a checkpoint containing batchnorm layers (tf 1.1.0). For this, following these posts and issues...
Read more >Freezing a Keras model - Towards Data Science
Now that the model has been trained and the graph and checkpoint files made we can use TensorFlow's freeze_graph.py to merge these together....
Read more >A Gentle Introduction to torch.autograd - PyTorch
We use the model's prediction and the corresponding label to calculate the error ( loss ). The next step is to backpropagate this...
Read more >tf.Graph | TensorFlow v2.11.0
Returns the names of the collections known to this graph. finalized, True if this graph has been finalized. graph_def_versions, The GraphDef version information ......
Read more >NVIDIA Deep Learning TensorRT Documentation
It selects subgraphs of TensorFlow graphs to be accelerated by TensorRT, while leaving the ... TensorRT's API has language bindings for both C++...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same behaviour here. convert_variables_to_constants changes ReadVariableOps to Identity nodes after transforming computed variables to constants. However some variables are attached to Enter nodes which are incompatible with the generated constants (eg. they expect a resource and they receive a flot). Any idea how can we fix Enter nodes?
Same error occurs, when using Autograph with LSTM-layer. Running the current master branch on commit 7c5157667006181f16efa3b70468ec1bd62cb070. Any news on how to fix this?