I am new to tensorflow and trying to get some examples to work from this book by OReilly “Learning Tensorflow.js” and I have installed node, and run the tensorflow install script npm install @tensorflow/tfjs
and when I run a simple example to check the version using these two lines:
import * as tf from '@tensorflow/tfjs';
console.log(tf.version.tfjs);
I get this error in the console:
'Cannot use import statement outside a module'
I don’t understand what the issue is because these files came right from the book download site.
Michael Florant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.