model.save() | ValueError: Cannot find any save handlers for URL
See original GitHub issueSystem information
- OS Platform and Distribution: Linux Debian 5.15.5-2kali2
- TensorFlow.js installed from: npm
- TensorFlow.js version: ^3.19.0
- Node version: v16.13.1
- NPM version: 8.1.2
Describe the current behavior I am trying to save the trained sequential model to the file system for later use. I have the same problem as the issues described in #4280 and #723. I have tried to any possible solution suggested in those posts but could not solve it. I am running an Electron application, the training code is called within the main process so it’s backed by NodeJS.
// Traning code
// ...
// Save model code
try {
let saveResults = await model.save('file://./myModel');
console.log(saveResults);
}catch ( e ) {
console.log(e);
}
This is the error log
ValueError: Cannot find any save handlers for URL 'file://./myModel'
at Sequential.save (webpack:///./node_modules/@tensorflow/tfjs-layers/dist/engine/training.js?:1561:23)
Describe the expected behavior According to Save and load models, the sequential tensorflow model files - [model].json & [model].weights.bin, should be saved in the file system.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Saving Model on Node: Cannot find any save handlers #723
Describe the problem or feature request save('file:///tmp/my-model-1'); but I get the error: UnhandledPromiseRejectionWarning: Error: Cannot find any save ...
Read more >Tensorflow.js save model using node - Stack Overflow
I had this same problem "Cannot find any save handlers for URL" when trying to use model.save(). The solution to my problem was...
Read more >Saving model on node to filesystem - Google Groups
I'm getting an error saving my model: Cannot find any save handlers for URL 'file://model/'. Can someone give a hand?! Nikhil Thorat's profile...
Read more >TensorFlow.js not able to save model - Reddit
When I run it I get this error: (node:2603) UnhandledPromiseRejectionWarning: Error: Cannot find any save handlers for URL 'file:///Users/ ...
Read more >Save and load models | TensorFlow.js
Saving a model in node.js does not prevent it from being loaded in the browser. Below we will examine the different schemes available....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i really really wouldn’t go down that path
but if you insist, check how
package.json
build.extraFiles
works forelectronjs
in short, you can use it to package
node_modules/@tensorflow/tfjs-node
which will include already built binary bindings for your platform. but if you need electron app built for anything but same platform as your dev system, no chance.i’ve already suggested two much cleaner ideas
.save()
and.load()
methods will actually use electron ipc to your nodejs main processAre you satisfied with the resolution of your issue? Yes No