How to get version info
Similar to the main Tensorflow (i.e using "tf.__ version __"), is there a way to get the current version in tensorflow.js?
For WEBGL version there is: tf.env().get('WEBGL_VERSION') but for TF.JS version there seems to know flags or other ways available.
If you're using the union package via import * as tf from '@tensorflow/tfjs', const tf = require('@tensorflow/tfjs'), or a script tag, the versions are exposed on the tf.version variable.
e.g.
> tf.version
{
'tfjs-core': '3.18.0',
'tfjs-backend-cpu': '3.18.0',
'tfjs-backend-webgl': '3.18.0',
'tfjs-data': '3.18.0',
'tfjs-layers': '3.18.0',
'tfjs-converter': '3.18.0',
tfjs: '3.18.0'
}
If you're using individual packages, each package has its own version variable:
import * as core from '@tensorflow/tfjs-core';
import * as cpu from '@tensorflow/tfjs-backend-cpu';
console.log('core: ', core.version_core, 'cpu: ', cpu.version_cpu);
core: 3.18.0 cpu: 3.18.0
Thank you!
Is there a reason why it's not included in the API doc? https://js.tensorflow.org/api/latest/
@mattsoulanille I have submitted a change here https://github.com/tensorflow/tfjs-website/pull/461 , could you please review.
please check the comments here https://github.com/tensorflow/tfjs-website/pull/461#issuecomment-1212552956 , we will not be implementing this change for now. Thank you!