4

I am struggling to get the save handler to work for saving my model. I've looked through all of stack overflow and GitHub, but no dice.

Ahhh help!!!! lol Thanks a bunch ahead of time!!! :)

Here is my model code:

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

const model = tf.sequential();
model.add(tf.layers.dense({ 
   units: 36,
   inputShape: [13]
}));

model.add(tf.layers.dense({ 
   units: 36, 
   activation: 'relu'
}));

model.add(tf.layers.dense({ 
   units: 1, 
   activation: 'sigmoid'
}));
    
model.compile({
   optimizer: 'adam',
   metrics: ['accuracy'],
   loss: 'meanSquaredError',
});

await model.fit(xs, ys, {
    epochs: 100
}).then(info => {
    console.log('Accuracy', info.history.acc);
});
await model.save(localhost())

Here is my package.json dependencies:

  "dependencies": {
    "@tensorflow/tfjs-node": "^2.1.0",
    "aws-sdk": "^2.695.0",
    "core-js": "^3.6.5",
    "node-fetch": "^2.6.0"
  }

Error Message:

ValueError: Cannot find any save handlers for URL
Juliana Hill
  • 400
  • 2
  • 15

1 Answers1

2

I had same issue, Try this model.save('file://model-name');

Barrard
  • 1,783
  • 1
  • 18
  • 25