有没有办法使tensorflow js从json文件而不是csv读取/训练数据? [英] is there a way to make tensorflow js read/train data from a json file instead of a csv?
本文介绍了有没有办法使tensorflow js从json文件而不是csv读取/训练数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
因此,我是机器学习的新手,并且一直在努力根据json文件提供的数据来训练模型.我使用CSV进行培训没有问题.另外,由于json文件并不简单,因此无法将json转换为csv.
So I'm new with machine learning and have been struggling with making my model train from the data provided from a json file. I have no problem training with a csv. Also converting the json to csv is not an option since the json file is not simple.
推荐答案
尝试避免自己进行转换;将JavaScript JSON库用于 JSON.parse
和 JSON.stringify
之类的函数,这些函数以递归方式深入数组中并将其转换为可通过Javascript编写的对象.
Try to avoid doing the conversion on your own; use the Javascript JSON library for functions like JSON.parse
and JSON.stringify
that go recursively deep in an array and turn it into a Javascript-subscriptable object.
这篇关于有没有办法使tensorflow js从json文件而不是csv读取/训练数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文