Questions tagged «tensorflow.js»

4
如何在Node.js(tensorflow.js)中训练模型?
我想做一个图像分类器,但是我不懂python。Tensorflow.js使用我熟悉的javascript。可以用它训练模型吗?要这样做的步骤是什么?坦白说,我不知道从哪里开始。 我唯一想到的就是如何加载“移动网络”,该网络显然是一组经过预先训练的模型,并使用它对图像进行分类: const tf = require('@tensorflow/tfjs'), mobilenet = require('@tensorflow-models/mobilenet'), tfnode = require('@tensorflow/tfjs-node'), fs = require('fs-extra'); const imageBuffer = await fs.readFile(......), tfimage = tfnode.node.decodeImage(imageBuffer), mobilenetModel = await mobilenet.load(); const results = await mobilenetModel.classify(tfimage); 可以,但是对我没有用,因为我想使用带有创建的标签的图像来训练自己的模型。 ======================= 说我有一堆图像和标签。如何使用它们训练模型? const myData = JSON.parse(await fs.readFile('files.json')); for(const data of myData){ const image = await fs.readFile(data.imagePath), labels …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.