I have a generator function it returns data & label value to the async function. I get an error message as not inputting data to the model
Also, I can not get value inside in async function. I am new to javascript. then how I can fix it. please help me. thank you...
This is my code...
async function* data() {
while (true) {
for (i in train) {
var data = [1, 2, 3, 4];
var size = [2, 2, 1];
yield (tf.tensor3d(data, size).div(tf.scalar(255.)));
}
}
}
async function* labels() {
while (true) {
for (i in train) {
var data = [1, 2, 3, 4];
var size = [2, 2];
yield (tf.tensor2d(data, size).expandDims(2));
}
}
}
async function initModel() {
}
(async function () {
const xs = tf.data.generator(data);
const ys = tf.data.generator(labels);
const model = await initModel();
model.summary();
console.log(xs, ys)
await model.fit(xs, ys,{
epochs: 5
batchesPerEpoch: 5
});
})();
What I have tried:
Getting out from xs and ys when console logs it not showing anything.
also, feed into the model it shows error not getting any input for the model