Accesing asset files from operations

40 views
Skip to first unread message

Fernando Neubaum

unread,
Mar 18, 2021, 3:52:20 PM3/18/21
to TensorFlow.js Discussion
I'm trying to port the operation InitializeTableFromTextFileV2 to Tensorflow.js, but I don't know how to access the text file from said operation.

I get the filename input argument which is an absolute path ending in .txt , but I don't know how to access that file or where it is. I'm assuming that location points to some place inside the .bin file, but I don't know how to open it. I just need a few pointers as I intend to to create a PR to add the operation, so any help is welcome.

I'm working in Node.js and the model is a saved model converted with the tfjs converter.

Thanks in advance,
Fernando

Na Li

unread,
Mar 19, 2021, 1:38:46 PM3/19/21
to TensorFlow.js Discussion, fern...@sulvo.com
Hi Fernando,
TF.js doesn't support this op yet. But if you use Node.js, you can pass SavedModel directly without conversion, and all TF core ops should be available to you: https://blog.tensorflow.org/2020/01/run-tensorflow-savedmodel-in-nodejs-directly-without-conversion.html

I think this op will instantiate a hashtable, then there should be other hashtable op to access it, e.g. LookupTableFindV2: https://www.tensorflow.org/api_docs/python/tf/raw_ops/LookupTableFindV2

Na

Reply all
Reply to author
Forward
0 new messages