I want to save a trained model from node.js using this function
async function tfModelExperiment(model) {
try {
let tsModelTraining = await model.save('file:///tmp/my-model-1');
}
catch (error) {
console.log(error);
}
}
but when saving the model it returns
(node:23756) UnhandledPromiseRejectionWarning: Error: Cannot find any save handlers for URL 'file:///tmp/my-model-1'
I found another person struggeling with this problem but it was fixed by including
const tf = require('@tensorflow/tfjs');
Which I already had, I've tried changing the directory to my home directory but that doesn't solve the problem, neither does running it as sudo, what could I be doing wrong?
Software I'm using Ubuntu Ubuntu 18.04.1 LTS with the most recent TensorFlow.js package (0.13.0) installed with npm
EDIT:
It should be noted that I tried
import * as tf from '@tensorflow/tfjs';
import '@tensorflow/tfjs-node';
As provided here (https://github.com/caisq/tfjs-node), which returns
TypeError: tf.sequential is not a function at file:///home/sjors/node.mjs:7:18 at ModuleJob.run (internal/loader/ModuleJob.js:94:14) at
And I've tried:
const tf = require('@tensorflow/tfjs');
require('@tensorflow/tfjs-node');
Which returns the same UnhandledPromiseRejectionWarning
error as before