1 | import tensorflow as tf |
1 | # 模型的保存 |
1 | mnist = input_data.read_data_sets("MNIST_data", one_hot=True) |
Extracting MNIST_data\train-images-idx3-ubyte.gz
Extracting MNIST_data\train-labels-idx1-ubyte.gz
Extracting MNIST_data\t10k-images-idx3-ubyte.gz
Extracting MNIST_data\t10k-labels-idx1-ubyte.gz
epoch:0, accuracy:0.9057
epoch:1, accuracy:0.9222
epoch:2, accuracy:0.9296
epoch:3, accuracy:0.9394
epoch:4, accuracy:0.9423
epoch:5, accuracy:0.9448
epoch:6, accuracy:0.9489
epoch:7, accuracy:0.9479
epoch:8, accuracy:0.9516
epoch:9, accuracy:0.9507
epoch:10, accuracy:0.9552
1 | mnist = input_data.read_data_sets("MNIST_data", one_hot=True) |
Extracting MNIST_data\train-images-idx3-ubyte.gz
Extracting MNIST_data\train-labels-idx1-ubyte.gz
Extracting MNIST_data\t10k-images-idx3-ubyte.gz
Extracting MNIST_data\t10k-labels-idx1-ubyte.gz
0.1311
INFO:tensorflow:Restoring parameters from D:/Tensorflow/models/test_net.ckpt
0.9552
总结:
如果是.pb模型文件,
保存用 graph_def()
导入用 tf.import_graph_def()