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.

Feature Request : tf.tensor.saveToComputer() tf.tensor.loadFromURL()

See original GitHub issue

I am doing some manipulation with the CIFAR-10 binary files (Not much fun, but it’s coming along. Each CIFAR binary is 10,000 items in this order: A label byte, then 32x32 bytes in this weird order: all the red, all the green, all the blue. Each file is 30,730,000 bytes long.). This file is not well organized for loading into a tensor. (Unless you have some secret trick.)

I can probably save a reorganized Uint8ClampedArray() and then load that into a tensor, but it would be really useful for sharing data to be able to completely save a tensor.

Unlike saving a model with local storage etc, for a tensor you would only need 2 methods:

tf.tensor.saveToComputer(myTensor, 'myTensorFileName.tfjs')

Then upload your saved tensor to your website or github. Then anyone wanting to use it could just:

tf.tensor.loadFromURL('https://myRepo/mySavedTensors/myTensorFileName.tfjs')

(The person might have to put the file on their website to manage CORS issues.)

Note: Model saving and loading is really useful, however manipulating a loaded model is fairly complex. With Tensor saving and loading available, then people could fairly easily make new models using the old data.

It would be great to have a .tfjs file extension.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
caisqcommented, Nov 21, 2018

@haganbt Got it! Thanks for letting us know. I’ll prioritize fixing #479.

0reactions
haganbtcommented, Dec 16, 2018

@caisq - it looks like #479 has been closed. Would it be possible to reopen and prioritize as I cannot find an alternative to load a model remotely without this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.data.experimental.save | TensorFlow v2.11.0
The save() implementation creates a tf.train.Checkpoint object internally, so users should not set the checkpoint argument in checkpoint_args .
Read more >
TensorFlow Tensor to a TensorFlow.js tensor - Stack Overflow
I was trying to take tensor from a ConvNet output and use it in another model in TF.js. Is there any way 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