model.save(url) | ValueError: Cannot find any save handlers for URL
See original GitHub issueSystem information
- OS Platform: Mac OSX 10.14.6
- tfjs: 2.7
- tfjs-node: 2.7
Standalone code to reproduce the issue
const serverAddr = "http://localhost:5001"
model = await tf.loadLayersModel(serverAddr + '/get-model')
model.compile({
optimizer: tf.train.adam(),
loss: 'categoricalCrossentropy',
metrics: ['accuracy']
});
model.train(...)
await model.save(serverAddr + '/upload-model') // ValueError occurs
A flask server is setup with endpoints /get-model and /upload-model. The /get-model endpoint provides an appropriate json, and so the model compile and trains properly. However, when trying to save the model to my Flask server, I receive the following error.
ValueError: Cannot find any save handlers for URL 'http://localhost:5001/upload-model' at new ValueError (/Users/colinpeppler/tfplayground/node_modules/@tensorflow/tfjs-layers/dist/tf-layers.node.js:186:28)
.
Running the code on the browser works good when saving to the url. I also tried saving to the filesystem and that worked fine, but the HTTP request method doesn’t work with node.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Saving Model on Node: Cannot find any save handlers #723
So I downgrade it to 1.2.3. I had an error with saving models: UnhandledPromiseRejectionWarning: Error: Cannot find any save handlers for URL 'file://./ ......
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
The save method takes a URL-like string argument that starts with a scheme. This describes the type of destination we are trying to...
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
A workaround in the meantime is to use https://js.tensorflow.org/api/latest/#io.http directly and pass that to tf.loadLayersModel.
This is a very common issues, most of the tfjs-examples models cannot e saved, ex jena-weather, boston-housing