Skip to content


Choose a tag to compare
@nsthorat nsthorat released this 06 Mar 22:41
· 5951 commits to master since this release

TensorFlow.js 1.0

TensorFlow.js 1.0 has been released!

With this release, we are aiming to have API stability guarantees and performance wins. For the most part, the breaking changes listed here are minor and should be relatively simple to migrate to new APIs.


TensorFlow.js 1.0 brings major performance gains on common machine learning models. Here is a graph of the performance gains of TensorFlow.js 1.0 versus last year in June 2018:



  • Tensor.array() and Tensor.arraySync() have been added. These are similar to but return deeply nested arrays with the same logical shape as the original tf.Tensor.

Breaking changes

  • Graphs converted from TensorFlow now generate JSON graphs (model.json). Any protocol buffer graphs with the extension .pb are now deprecated. You can convert .pb graphs to .json graphs with the pb2json NPM script in the tensorflow/tfjs-converter repository.
  • tf.loadModel is deleted. Please use tf.loadLayersModel instead.
  • tf.loadFrozenModel is deleted. Please use tf.loadGraphModel instead.
  • tf.Model has been renamed tf.LayersModel.
  • tf.FrozenModel has been renamed tf.GraphModel.
  • When converting models with the tensorflowjs pip package, use --output_format strings tfjs_layers_model and tfjs_graph_model instead and tensorflowjs.
  • Tensor.get is deleted. Please use Tensor.array and native array indexing instead.
  • Tensor.buffer is now async (returns a Promise). If you need the sync version, please use Tensor.bufferSync.
  • tf.fromPixels is deleted. Please use tf.browser.fromPixels instead.
  • tf.toPixels is deleted. Please use tf.browser.toPixels instead.
  • tf.batchNormalization is deprecated. Please use tf.batchNorm. Note the positional change of the arguments.
  • Dataset.forEach is deleted. Please use DataSet.forEachAsync instead.
  • LayersModel.fitDataset now only accepts {xs, ys} as a dictionary mapping 'xs' and 'ys' to their respective Tensor values. The [xs, ys] tuple format is now removed.
  • now takes two arguments, a url and an options object. See the new API here.
  • now takes a generator function*, instead of an iterator. See API doc.