github tensorflow/tfjs v1.0.0
1.0.0

latest releases: tfjs-v4.19.0-rc.0, tfjs-v4.18.0, tfjs-v4.18.0-rc.0...
5 years ago

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.

Performance

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:

image

Features

  • Tensor.array() and Tensor.arraySync() have been added. These are similar to Tensor.data() 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.
  • tf.io.browserHTTPRequest now takes two arguments, a url and an options object. See the new API here.
  • tf.data.generator() now takes a generator function*, instead of an iterator. See API doc.

Don't miss a new tfjs release

NewReleases is sending notifications on new releases.