New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: Load LSTM Model twice causes error #1218
Comments
Hello, could you mind providing your version of TensorFlow.NET? And how do you save and load model (we recommend to use keras.models.load_model to load the whole model rather than save and load weight, because it has a more comprehensive implementation)? I use the following code to save model, then load it and predict it twice, and it works well. (The version of my TensorFlow.NET and TensorFlow.Keras is 0.110.4)
|
I use a version 0.150.0. model.save("./mnist_model"); keras.backend.clear_session(); keras.backend.clear_session(); Without the weights two predictions of same inputs do not match. |
Hello, could you please try use version 0.110.4 for now? I run the code you provided above in version 0.110.4, it runs well, and it fails when in version 0.150.0. |
Description
Use example TrainLSTMWithMnist() in Rnn.Test.cs to train and save model. Then load exported model and predict TestData of Mnist.
Do this loading and prediction twice cause Tensorflow.InvalidArgumentError:“Matrix size-incompatible: In[0]: [32,50], In[1]: [28,200]”
Alternatives
No response
The text was updated successfully, but these errors were encountered: