Saving model on node to filesystem

706 views
Skip to first unread message

Tiago Vasconcelos

unread,
Jul 16, 2018, 12:16:36 PM7/16/18
to TensorFlow.js Discussion
I'm getting an error saving my model: Cannot find any save handlers for URL 'file://model/'

Can someone give a hand?!

Nikhil Thorat

unread,
Jul 16, 2018, 1:20:11 PM7/16/18
to Tiago Vasconcelos, TensorFlow.js Discussion
Can you give us more information? Can you post your code here? Running in browser or Node? TensorFlow.js version? etc.

On Mon, Jul 16, 2018 at 12:16 PM Tiago Vasconcelos <talvasc...@gmail.com> wrote:
I'm getting an error saving my model: Cannot find any save handlers for URL 'file://model/'

Can someone give a hand?!

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/0a48a041-6ae3-4131-b937-6ceb893d7760%40tensorflow.org.

Tiago Vasconcelos

unread,
Jul 16, 2018, 1:23:41 PM7/16/18
to TensorFlow.js Discussion, talvasc...@gmail.com
sorry... 

running on windows, no browser just node, using latest tfjs 

load().then(async () => {
 await train()
 await test()
 await model.save('file://model/')
}).catch(console.error)

load, just loads the data, run train, then predictions, after that o try to save the model to the filesystem... is it a windows thing?

Shanqing Cai

unread,
Jul 16, 2018, 1:28:29 PM7/16/18
to talvasc...@gmail.com, TensorFlow.js Discussion
Tiago, 

This could be a tfjs bug on Windows, as we currently don't have CI testing for tfjs-node on Windows. Can you try one thing? Instead of the URL 'file://model/', can you add './' in front of 'model', i.e., 'file://./model/'? This way you can use a path relative to the current working directory. Let us know what happens with that URL. Thanks.

Best,
Shanqing



--
---
Shanqing Cai
Software Engineer
Google

Tiago Vasconcelos

unread,
Jul 16, 2018, 1:35:50 PM7/16/18
to TensorFlow.js Discussion, talvasc...@gmail.com
Same error, i guess i've tried it before. 

Tried, full path: c:/Users....... also, no go!! it may be a windows thing. i may get it to run from the browser then, cause it works there, i tried the download demo on the website. just need a few lines worked around...

Shanqing Cai

unread,
Jul 16, 2018, 1:45:26 PM7/16/18
to TensorFlow.js Discussion, talvasc...@gmail.com
I will file an issue on GitHub to track this tfjs-node + Windows bug (after GitHub comes back online, that is!)

Nick Kreeger

unread,
Jul 16, 2018, 1:55:37 PM7/16/18
to Shanqing Cai, TensorFlow.js Discussion, Tiago Vasconcelos
Hi Tiago - 

We currently don't have a windows build for tfjs-node. This might be part of the problem. Can you provide the full source code (github link?), and any other output to the Github issue?

Thanks,
Nick

Shanqing Cai

unread,
Jul 16, 2018, 1:58:54 PM7/16/18
to talvasc...@gmail.com, TensorFlow.js Discussion
running on windows, no browser just node, using latest tfjs 

Tiago, 

Just to cover the ground: you said you were using the latest version of tfjs. How about the version of tfjs-node? It has a separate version from tfjs proper.
 

On Monday, July 16, 2018 at 6:20:11 PM UTC+1, Nikhil Thorat wrote:
Can you give us more information? Can you post your code here? Running in browser or Node? TensorFlow.js version? etc.

On Mon, Jul 16, 2018 at 12:16 PM Tiago Vasconcelos <talvasc...@gmail.com> wrote:
I'm getting an error saving my model: Cannot find any save handlers for URL 'file://model/'

Can someone give a hand?!

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/0a48a041-6ae3-4131-b937-6ceb893d7760%40tensorflow.org.

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.

Tiago Vasconcelos

unread,
Jul 17, 2018, 6:41:23 AM7/17/18
to TensorFlow.js Discussion, talvasc...@gmail.com
Hi, i'm not using tfjs-node, i'm on windows atm... 

Shanqing Cai

unread,
Jul 17, 2018, 8:12:49 AM7/17/18
to Tiago Vasconcelos, TensorFlow.js Discussion
On Tue, Jul 17, 2018 at 6:41 AM Tiago Vasconcelos <talvasc...@gmail.com> wrote:
Hi, i'm not using tfjs-node, i'm on windows atm... 

To use tensorflow.js in Node.js, you need to import tfjs-node. Otherwise, the native filesystem handler won't be available, which is probably the reason for the issue you are having. In addition, without importing Node.js, you will end up using the default JavaScript CPU math backend of tensorflow.js, which is way slower than the parallelized CPU or GPU backends that come with tfjs-node.
 

Iconoclasta Vesgo

unread,
Jul 17, 2018, 10:08:32 AM7/17/18
to Shanqing Cai, TensorFlow.js Discussion
This is why i haven't installed tfjs-node:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs...@0.1.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @tensorflow/tfjs...@0.1.9 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


John S

unread,
Jul 17, 2018, 10:14:34 AM7/17/18
to TensorFlow.js Discussion
I get the same results. Tfjs-node doesn’t support Windows atm.
Go for a VM or use the Docker image someone posted a few posts back. It works fine!

Iconoclasta Vesgo

unread,
Jul 17, 2018, 10:18:16 AM7/17/18
to John S, TensorFlow.js Discussion
never used docker before... guess i'll give it a try

On Tue, Jul 17, 2018 at 3:14 PM John S <swanj...@gmail.com> wrote:
I get the same results. Tfjs-node doesn’t support Windows atm.
Go for a VM or use the Docker image someone posted a few posts back. It works fine!

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
Reply all
Reply to author
Forward
0 new messages