tensorflowjs_converter and scalars instead of tensors
See original GitHub issueTensorFlow.js version
{“tfjs-core”: “0.12.11”, “tfjs-layers”: “0.7.4”, “tfjs-converter”: “0.5.7”, tfjs: “0.12.5” }
Describe the problem
There’s something wrong in the conversion process from frozenModels. In fact, when I actually created the model (in python - tensorflow) I wrote:
self.scalarInput = tf.placeholder(shape=[None,21168],dtype=tf.float32, name=“main_scalarinput”)
I correctly do predictions in a C++ Tensorflow-based application that uses a frozen version of this model. I’d like to do the same in a tfjs-based webapp. However, after running tensorflowjs_converter and writing the code to load the converted model, I am not able to feed data in the model, since it accepts only scalars. Inspecting the model inputs I can see:
0: Object { name: "main_scalarinput", **shape: []**, dtype: "float32" }
1: Object { name: "main_batch_size", shape: [], dtype: "int32" }
2: Object { name: "main_train_length", shape: [], dtype: "int32" }
which is in contrast with the actual definition of the model.
.pb model here: https://drive.google.com/file/d/1tU-6tYhXTGhFOjy6Eycqt2rwnOoOYmw6/view?usp=sharing
Any workaround?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top GitHub Comments
Great, @pyu10055, thanks a lot! I’m waiting for npmjs publish in order to try that! [ETA?] In the meanwhile, I’d like to ask you for another problem with my unlucky model… in my model there’s a LSTM cell: in python (but also in the C++ tensorflow-based app) I am able to feed in the input tensor and also a particular rnn state, do inference, get back output and rnn state (to be used in the next inference execution with another input)… however tfjs refuses input at node named “main_state_in” because it has already decided that this is not an input node. How can I specify in the tfjs conversion process that this particular node is input?
Here it is the graphdef: standard_DRQN_graphdef.pbtxt.zip
is your output of tf version code same with your tfjs version code?