Feature Request : tf.tensor.saveToComputer() tf.tensor.loadFromURL()
See original GitHub issueI 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:
- Created 5 years ago
- Comments:12 (2 by maintainers)
Top GitHub Comments
@haganbt Got it! Thanks for letting us know. I’ll prioritize fixing #479.
@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.