You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning, once the model has been trained and saved to disk, then when trying to load it, it returns an error
Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object\n at Function.keys ()\n at NeuralNlu.fromJSON
I am training the network with:
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const manager = new NlpManager({ languages: ['es'], forceNER: true, modelFileName: FileName, autoSave: false });
manager.train();
manager.save();
and then to load it (in other process):
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const manager = new NlpManager({ languages: ['es'] });
manager.load(FileName);
I have also tried with the import method and it returns the same error:
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const data = fs.readFileSync(FileName, 'utf8');
const manager = new NlpManager({ languages: ['es'] });
manager.import(data);
Can anyone know what causes this error?
Thank you very much
The text was updated successfully, but these errors were encountered:
Sorry, I solved the error,
It was a problem when saving the model, although it looked well structured if I opened it in a text editor, it was not created well, I close the thread.
Thank you.
Good morning, once the model has been trained and saved to disk, then when trying to load it, it returns an error
Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object\n at Function.keys ()\n at NeuralNlu.fromJSON
I am training the network with:
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const manager = new NlpManager({ languages: ['es'], forceNER: true, modelFileName: FileName, autoSave: false });
manager.train();
manager.save();
and then to load it (in other process):
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const manager = new NlpManager({ languages: ['es'] });
manager.load(FileName);
I have also tried with the import method and it returns the same error:
var FileName = "./ScriptsNodejs/ModelsTrained/ModelTrained.json";
const data = fs.readFileSync(FileName, 'utf8');
const manager = new NlpManager({ languages: ['es'] });
manager.import(data);
Can anyone know what causes this error?
Thank you very much
The text was updated successfully, but these errors were encountered: