const tf= require('@tensorflow/tfjs');
require('@tensorflow/tfjs-node');
console.log("HI");const tf= require('@tensorflow/tfjs');require('@tensorflow/tfjs-node');
Train a simple model:const model = tf.sequential();model.add(tf.layers.dense({units: 100, activation: 'relu', inputShape: [10]}));model.add(tf.layers.dense({units: 1, activation: 'linear'}));model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});
const xs = tf.randomNormal([100, 10]);const ys = tf.randomNormal([100, 1]);
model.fit(xs, ys, { epochs: 100, callbacks: { onEpochEnd: (epoch, log) => console.log(`Epoch ${epoch}: loss = ${log.loss}`), }});
Can you confirm if a simple Node program works eg an express server or hello world or such just to confirm other modules working on your PC? - Yes it works like that. And as you observe the "node error.jpg" attachments in the first email. You should observe that "Hi" was printed before the error was shown.Can you also try npm install -u for tfjs so it installs at user level in case its some visibility issue with folder it got downloaded to etc?- I did this too as per your suggestion, but didnt work :)
--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/83c4be57-7e35-415a-8aaf-3e1c0d524a9b%40tensorflow.org.
![]() | • Jason Mayes • Follow my discoveries or contribute your own |