将 Tensorboard 与 Tensorflow.js 一起使用

Use Tensorboard With Tensorflow.js

我想使用 tensorboard 可视化我的模型拟合。

tensorboard tutorial (which is for python) and in the API docs (JS) 的说明使用 tf.node

但是tf.node不存在。

TypeError: Cannot read property 'summaryFileWriter' of undefined

我的代码:

require('@tensorflow/tfjs-node');
console.clear();
require('dotenv').config();
const debugTf = require('debug')('tf');
const debugTfVerbose = require('debug')('tf:verbose');
const tf = require('@tensorflow/tfjs');
const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir');

我正在使用 "@tensorflow/tfjs-node": "^1.2.3"

根据 documentation,命名空间 tf 应该关联到包 tfjs-node 而不是 tf

const tf = require('@tensorflow/tfjs-node');