Import/Export of JSON for model is not working
See original GitHub issueWhat is wrong?
Export/Import functionality of the library is not working, the JSON is not in the correct format to be considered JSON.
Where does it happen?
Windows 10 node version 8
How do we replicate the issue?
`const brain = require('brain.js);
var net = new brain.recurrent.RNN();
net.train([{input: [0, 0], output: [0]}, {input: [0, 1], output: [1]}, {input: [1, 0], output: [1]}, {input: [1, 1], output: [0]}]);
var output = net.run([0, 0]); // [0] output = net.run([0, 1]); // [1] output = net.run([1, 0]); // [1] output = net.run([1, 1]); // [0]
console.log(net.toJSON()) // JSON is in incorrect format, am i missing something? `
How important is this (1-5)?
4 - love this library but can’t use it for Production use cases until i can export/import
Expected behavior (i.e. solution)
JSON is exported in valid format
Other Comments
N/A - love this Library tho
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to make import-export save JSONField not as string
I tried to create a Field with the JSONWidget widget, but doesn't work. models.py @receiver(post_save, sender=Governorate) def ...
Read more >Import/export from json - Self Hosted Retool
I used to export an app as a json file on my dev environment and then import json on production environment, which works...
Read more >importing json OR csv with blank id column still results in ...
Same problem here. The resource and admin classes are setup according to the documentation, and export is working fine.
Read more >Import Export JSON Model - PlayCanvas Forum
Hi, I'm trying to copy JSON Models from Project A to Project B, ... I upload json model files, editor recognizes as JSON...
Read more >Refactor Import/Export JSON load/dumping - Issues - GitLab
Currently, we load the JSON in batches, freeing objects from memory per batch and committing to the DB after each batch.
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
May be the problem. JSON.parse reads a string in, you want to pass the string of the source of
input-output-trainedmodel.json
Yea, just use
and then later:
Yes you are correct. Thanks so much! Sorry, I knew that the reading in was a javascript issue not a brain js issue I just didn’t know how to achieve it. I’m a .NET developer by trade so little rusty with the ol’ JS side of things.
Thanks again.