Where to put array in model.predict() function
See original GitHub issueI have imported a pre trained keras model in my jvascript. I want to put array into the model to get he output. To convert the array to sensor I am taking the help from model.predict(tf.ones([8, 10]), {batchSize: 4}).print(); written in tfjs tutorial.
But where and how should I keep my array inside this model.predict() function.
I have to insert array([[0., 0., 0., …, 0., 0., 0.]]) with (1,30000) shape. I tried following line but couldn’t get the result:
console.log(model.predict(tf.ones([1, 30000]), Array(b)));
Please tell me how to do it so I can get the output.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to make model.predict in array? - python - Stack Overflow
i want my model.predict shows me an array ([0. 1.] or [1. 0.]) instead of just a single number 0 or 1, so...
Read more >What does the output of model.predict function from Keras ...
I am only showing the first 10 values in the array. I don't understand what do these values mean and what is the...
Read more >How to use a model to do predictions with Keras - ActiveState
Keras models can be used to detect trends and make predictions, using the model.predict() class and it's variant, ...
Read more >How to Make Predictions with Keras - Machine Learning Mastery
This can be passed to the predict_classes() function on our model in order to predict the class values for each instance in the...
Read more >Making predictions - Decision Forests - TensorFlow
Use the model.predict() function on Numpy arrays. Make predictions with the CLI API. Benchmark the inference speed of a model with the CLI ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@xam-ps Thank you so much, The code is working.
@kallols To get the data from the tensor I’m using the data() function. For your case this should be sth. like:
newoutput.data().then(function(label){ console.log(label[0]); console.log(label[1]); });