tf.io.browserFiles used in API documentation but not documented

243 views
Skip to first unread message

Ken Kahn

unread,
Oct 9, 2018, 9:13:03 AM10/9/18
to TensorFlow.js Discussion
https://js.tensorflow.org/api/latest/#loadModel

has an example using browserFiles but that is its only occurrence on the page. Easy to guess what it does but shouldn't it be documented?

Stan Bileschi

unread,
Oct 9, 2018, 10:57:02 AM10/9/18
to TensorFlow.js Discussion
Hi Ken,

  Thanks for the question.  I agree that the documentation is thin here.  There is only the API reference, and then also a reference in the model-save-load tutorial.  

What sort of documentation do you think would be helpful here.  Something about how the browserFiles loading looks and feels?  A tfjs-example that includes browser files?

Sincerely,
Stan

Ken Kahn

unread,
Oct 9, 2018, 11:30:01 AM10/9/18
to bile...@google.com, tf...@tensorflow.org
Hi

There are these two examples already:

const saveResults = await model.save('downloads://my-model-1');

and

// Note: this code snippet will not work without the HTML elements in the
//   page
const jsonUpload = document.getElementById('json-upload');
const weightsUpload = document.getElementById('weights-upload');
const model = await tf.loadModel(
     tf.io.browserFiles([jsonUpload.files[0], weightsUpload.files[0]]));

 A brief description of what tf.io.browserFiles does is all that is missing.

On a related note, I just discovered that the name of a model is lost when saved and loaded. Though the JSON includes

"paths":["./test-1.weights.bin"]

so it isn't completely lost.

Best,

-ken

--
You received this message because you are subscribed to a topic in the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/a/tensorflow.org/d/topic/tfjs/nsa7_oZq2gc/unsubscribe.
To unsubscribe from this group and all its topics, 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/cb459dd6-3857-426f-ac2b-26e89f6d95da%40tensorflow.org.
Reply all
Reply to author
Forward
0 new messages