1.0.0
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:
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 originaltf.Tensor.
Breaking changes
- Graphs converted from TensorFlow now generate JSON graphs (
model.json). Any protocol buffer graphs with the extension.pbare now deprecated. You can convert.pbgraphs to.jsongraphs with thepb2jsonNPM script in the tensorflow/tfjs-converter repository. tf.loadModelis deleted. Please use tf.loadLayersModel instead.tf.loadFrozenModelis deleted. Please use tf.loadGraphModel instead.tf.Modelhas been renamedtf.LayersModel.tf.FrozenModelhas been renamedtf.GraphModel.- When converting models with the tensorflowjs pip package, use
--output_formatstringstfjs_layers_modelandtfjs_graph_modelinstead andtensorflowjs. Tensor.getis deleted. Please use Tensor.array and native array indexing instead.Tensor.bufferis now async (returns a Promise). If you need the sync version, please use Tensor.bufferSync.tf.fromPixelsis deleted. Please use tf.browser.fromPixels instead.tf.toPixelsis deleted. Please use tf.browser.toPixels instead.tf.batchNormalizationis deprecated. Please use tf.batchNorm. Note the positional change of the arguments.Dataset.forEachis deleted. Please useDataSet.forEachAsyncinstead.LayersModel.fitDatasetnow 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.browserHTTPRequestnow takes two arguments, a url and an options object. See the new API here.tf.data.generator()now takes a generatorfunction*, instead of an iterator. See API doc.
