Train imported model from JSON fails
See original GitHub issueTrying to train an imported model from JSON fails.
Use case:
let net = new LSTM();
const trainingData = [
{
input: 'hi',
output: 'mom',
},
{
input: 'howdy',
output: 'dad',
},
{
input: 'hello',
output: 'sis',
},
{
input: 'yo',
output: 'bro',
},
];
net.train(trainingData, { iterations: 20 });
const net2 = new LSTM().fromJSON(net.toJSON());
net2.train(trainingData, { iterations: 20 });
net2.run('hi');
Error:
Error: Network error rate is unexpected NaN, check network configurations and try again.
Most probably input format is not correct or training data is not enough.
at LSTM.train (brain.js\src\recurrent\rnn.ts:628:15)
Fix: Setting dataFormatter.isSetup to true in DataFormatter.fromJSON solve the problem
dataFormatter.isSetup = true;
So is there any drawback for this Fix ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
"WARNING:tensorflow:Model failed to initialize as JSON ...
from keras.layers.merge import add, concatenate from keras.models import Model from keras.engine.topology import Layer import tensorflow as ...
Read more >Keras won't load json file - deep learning - Stack Overflow
I ran my code and saved saved my model using the following code: model_json = model.to_json() with open(inFilePath+".json", ...
Read more >Loading model from .params and .json fails - Gluon
json files. I'd like to instantiate the model, but this command: net = gluon.nn.SymbolBlock.imports("model_algo_1-symbol.
Read more >Struggling to import my object det… | Apple Developer Forums
Whenever I try and import my training data I get the error message: Training Data Error: Empty table from specified data source.
Read more >What to do when you get an error - Hugging Face Course
If we read the accompanying error message, we can see that there seems to be a problem with the model's config.json file, and...
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 FreeTop 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
Top GitHub Comments
Any progress on figuring this out? This is pretty much useless without being able to save a previous network.
Thanks for reproducing. I’ll look at this early this week.