question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

model.save(url) | ValueError: Cannot find any save handlers for URL

See original GitHub issue

System 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:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tafsiricommented, Nov 24, 2020

A workaround in the meantime is to use https://js.tensorflow.org/api/latest/#io.http directly and pass that to tf.loadLayersModel.

0reactions
timekarmacommented, Sep 7, 2021

This is a very common issues, most of the tfjs-examples models cannot e saved, ex jena-weather, boston-housing

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found