人工智能TensorFlow MNIST手写数字识别——实战篇

上期文章TensorFlow手写数字-训练篇,我们训练了我们的神经网络,本期使用上次训练的模型,来识别手写数字(本期构建TensorFlow神经网络代码为上期文章分享代码)

http://scs.ryerson.ca/~aharley/vis/conv/
0、插入第三方库

from PIL import Image# 处理图片
import tensorflow as tf
import numpy as np


1、图片处理函数

def image_tva():
file_name='data/1.png'#导入自己的图片
im = Image.open(file_name).convert('L')
tv = list(im.getdata()) #get pixel values
#normalize pixels to 0 and 1. 0 is pure white, 1 is pure bl

猜你喜欢

转载自blog.csdn.net/weixin_44782294/article/details/131905945