Tensorflow - Testing a mnist neural net with my own images

后端 未结 1 543
轻奢々
轻奢々 2021-02-14 10:50

I\'m trying to write a script that will allow me to draw an image of a digit and then determine what digit it is with a model trained on MNIST.

Here is my code:

相关标签:
1条回答
  • 2021-02-14 11:21

    I found my mistake: it encoded the reverse, blacks were at 255 instead of 0.

     data = np.vectorize(lambda x: 255 - x)(np.ndarray.flatten(scipy.ndimage.imread("im_01.jpg", flatten=True)))
    

    Fixed it.

    0 讨论(0)
提交回复
热议问题