Relative Content

Tag Archive for tensorflowtensorflow.jsmnist

TensorFlow Question Related to Mnist Dataset Classification

I am following a Edx course named as Google AI for JavaScript developers with TensorFlow.js . Following the course there is a project where classification is taught using Mnist Dataset and the lecturer leaves it upto us if we want to extend the project where we could manually draw numbers on a canvas and see if the model can predict what number we wrote. I gave this project a try and I have implemented everything my model has a 0.97 accuracy and I am able to draw on canvas using JS and have converted the image to grayscale and then normalized and then resized it from 168 x 168 to 28 by 28. I have even included a debugging canvas to see if the converted image is correct and it displays the image what I drew but somehow I am unable to predict them correctly and I cant seem to figure out what is wrong with my code. here is the relevent function that is doing everything related to making predictions. Any help would be much appreciated, I have been stuck on this for 2 days now