【发布时间】:2020-08-09 19:12:58
【问题描述】:
我正在努力让保存处理程序工作以保存我的模型。我浏览了所有的堆栈溢出和 GitHub,但没有骰子。
啊啊啊救命啊!!!哈哈 提前多谢!!! :)
这是我的型号代码:
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())
这是我的package.json 依赖项:
"dependencies": {
"@tensorflow/tfjs-node": "^2.1.0",
"aws-sdk": "^2.695.0",
"core-js": "^3.6.5",
"node-fetch": "^2.6.0"
}
错误信息:
ValueError: Cannot find any save handlers for URL
【问题讨论】:
-
试试
model.save('file://my-model'); -
这在我最初遇到问题时不起作用,或者我不会求助于在这里提出问题。
标签: javascript node.js artificial-intelligence tensorflow2.0 tfjs-node