Answers.Body: <p>To test the model, you have to achieve a Tensor with the same dimensions as the training data. This Tensor should be the same for the same image, no matter how many times you remake the Tensor with the same image. That being said, you can attempt to reverse-engineer how the Tensors are being made. Hint: The dimensions of the input tensor should be (28, 28, 1).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-25T16:53:11.927Z
Answers.LastActivityDate: 2018-06-25T16:53:11.927Z
Answers.UserDisplayName: FreezePhoenix
Body: <p>I'm new to machine learning, so i figured I should look into google's tensor flow guides and I know how to code in JS so that's why I'm using tensorflow.js, there's and example in the guide that trains itslef to recognize handwritten numbers from the  MNIST handwriting dataset, I sort of understand what's going on in the code but since I'm very new to ML it's not a lot, I went through the code and saw that it didn't took image by image to train itself but it requests one sprite which contains all the images and then cuts it into what it needs, this makes sense from a performance point of view, but as this process is kind of abstract I don't understand what's really going on, I want to upload an image of my own and call the predictor of the model but I don't know how to do it, any help? </p>
  
  <p>I was thinking that drawing in a canvas of 28x28 a number might be very interesting as well instead of uploading an image, but I need to know how to test the model once it's trained with my own data.</p>
  
  <p>The tutorial: <a href="https://js.tensorflow.org/tutorials/mnist.html" rel="nofollow noreferrer">https://js.tensorflow.org/tutorials/mnist.html</a></p>
  
Tags: <machine-learning><convolutional-neural-networks><image-recognition>
Title: How to load an image into tensorflow.js code which reads handwritten numbers and clasify them
UserDisplayName: Marco Morales
ThreadText: # How to load an image into tensorflow.js code which reads handwritten numbers and clasify them
  
  (Asked by: username_0 on 2018-06-22)
  
  I'm new to machine learning, so i figured I should look into google's tensor flow guides and I know how to code in JS so that's why I'm using tensorflow.js, there's and example in the guide that trains itslef to recognize handwritten numbers from the MNIST handwriting dataset, I sort of understand what's going on in the code but since I'm very new to ML it's not a lot, I went through the code and saw that it didn't took image by image to train itself but it requests one sprite which contains all the images and then cuts it into what it needs, this makes sense from a performance point of view, but as this process is kind of abstract I don't understand what's really going on, I want to upload an image of my own and call the predictor of the model but I don't know how to do it, any help?
  
  I was thinking that drawing in a canvas of 28x28 a number might be very interesting as well instead of uploading an image, but I need to know how to test the model once it's trained with my own data.
  
  The tutorial: <https://js.tensorflow.org/tutorials/mnist.html>
  
  **Tags:** machine-learning, convolutional-neural-networks, image-recognition
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-25. Score: 1
  
  To test the model, you have to achieve a Tensor with the same dimensions as the training data. This Tensor should be the same for the same image, no matter how many times you remake the Tensor with the same image. That being said, you can attempt to reverse-engineer how the Tensors are being made. Hint: The dimensions of the input tensor should be (28, 28, 1).
  
  
  ---
  
  