慕码人6266623
2018-06-08 21:39
以下是输出
/home/tonyng/tensorflow/bin/python3.6 /home/tonyng/PycharmProjects/mnist_testdemo/mnist/convolutional.py
WARNING:tensorflow:From /home/tonyng/PycharmProjects/mnist_testdemo/mnist/convolutional.py:6: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
Extracting MNIST_data/train-images-idx3-ubyte.gz
WARNING:tensorflow:From /home/tonyng/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Please write your own downloading logic.
WARNING:tensorflow:From /home/tonyng/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting MNIST_data/train-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/tonyng/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
WARNING:tensorflow:From /home/tonyng/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:110: dense_to_one_hot (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.one_hot on tensors.
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /home/tonyng/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
2018-06-08 21:30:39.110823: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-06-08 21:30:39.161129: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-06-08 21:30:39.161530: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties:
name: GeForce GTX 960M major: 5 minor: 0 memoryClockRate(GHz): 1.176
pciBusID: 0000:02:00.0
totalMemory: 3.95GiB freeMemory: 3.46GiB
2018-06-08 21:30:39.161545: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0
2018-06-08 21:30:39.733274: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-06-08 21:30:39.733300: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929] 0
2018-06-08 21:30:39.733307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N
2018-06-08 21:30:39.733436: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3192 MB memory) -> physical GPU (device: 0, name: GeForce GTX 960M, pci bus id: 0000:02:00.0, compute capability: 5.0)
step 0, training accuracy 0.06
step 100, training accuracy 0.12
step 200, training accuracy 0.08
step 300, training accuracy 0.08
step 400, training accuracy 0.08
step 500, training accuracy 0.06
step 600, training accuracy 0.08
step 700, training accuracy 0.14
step 800, training accuracy 0.12
step 900, training accuracy 0.08
step 1000, training accuracy 0.12
step 1100, training accuracy 0.1
step 1200, training accuracy 0.12
step 1300, training accuracy 0.08
step 1400, training accuracy 0.06
step 1500, training accuracy 0.12
step 1600, training accuracy 0.16
step 1700, training accuracy 0.06
step 1800, training accuracy 0.02
step 1900, training accuracy 0.1
step 2000, training accuracy 0.12
step 2100, training accuracy 0.08
step 2200, training accuracy 0.1
step 2300, training accuracy 0.12
step 2400, training accuracy 0.12
step 2500, training accuracy 0.08
step 2600, training accuracy 0.02
step 2700, training accuracy 0.06
step 2800, training accuracy 0.08
step 2900, training accuracy 0.04
step 3000, training accuracy 0.1
step 3100, training accuracy 0.08
step 3200, training accuracy 0.04
step 3300, training accuracy 0.06
step 3400, training accuracy 0.04
step 3500, training accuracy 0.08
step 3600, training accuracy 0.1
step 3700, training accuracy 0.06
step 3800, training accuracy 0.08
step 3900, training accuracy 0.02
step 4000, training accuracy 0.02
step 4100, training accuracy 0.14
step 4200, training accuracy 0.1
step 4300, training accuracy 0.08
step 4400, training accuracy 0.02
step 4500, training accuracy 0.08
step 4600, training accuracy 0.02
step 4700, training accuracy 0.06
step 4800, training accuracy 0.1
step 4900, training accuracy 0.08
step 5000, training accuracy 0.02
step 5100, training accuracy 0.22
step 5200, training accuracy 0.08
step 5300, training accuracy 0.12
step 5400, training accuracy 0.1
step 5500, training accuracy 0.12
step 5600, training accuracy 0.1
step 5700, training accuracy 0.12
step 5800, training accuracy 0.04
step 5900, training accuracy 0.06
step 6000, training accuracy 0.12
step 6100, training accuracy 0.08
step 6200, training accuracy 0.08
step 6300, training accuracy 0.1
step 6400, training accuracy 0.04
step 6500, training accuracy 0.04
step 6600, training accuracy 0.06
step 6700, training accuracy 0.1
step 6800, training accuracy 0.04
step 6900, training accuracy 0.04
step 7000, training accuracy 0.12
step 7100, training accuracy 0.04
step 7200, training accuracy 0.04
step 7300, training accuracy 0.08
step 7400, training accuracy 0.08
step 7500, training accuracy 0.1
step 7600, training accuracy 0.08
step 7700, training accuracy 0.12
step 7800, training accuracy 0.14
step 7900, training accuracy 0.06
step 8000, training accuracy 0.06
step 8100, training accuracy 0.06
step 8200, training accuracy 0.08
step 8300, training accuracy 0.02
step 8400, training accuracy 0.08
step 8500, training accuracy 0.06
step 8600, training accuracy 0.08
step 8700, training accuracy 0.1
step 8800, training accuracy 0.12
step 8900, training accuracy 0
step 9000, training accuracy 0.16
step 9100, training accuracy 0.1
step 9200, training accuracy 0.12
step 9300, training accuracy 0.08
step 9400, training accuracy 0.1
step 9500, training accuracy 0.06
step 9600, training accuracy 0.1
step 9700, training accuracy 0.08
step 9800, training accuracy 0.1
step 9900, training accuracy 0.06
step 10000, training accuracy 0
step 10100, training accuracy 0.16
step 10200, training accuracy 0.06
step 10300, training accuracy 0.02
step 10400, training accuracy 0.1
step 10500, training accuracy 0.1
step 10600, training accuracy 0.08
step 10700, training accuracy 0.16
step 10800, training accuracy 0.1
step 10900, training accuracy 0.14
step 11000, training accuracy 0.1
step 11100, training accuracy 0.04
step 11200, training accuracy 0.18
step 11300, training accuracy 0.04
step 11400, training accuracy 0.18
step 11500, training accuracy 0.1
step 11600, training accuracy 0.08
step 11700, training accuracy 0.06
step 11800, training accuracy 0.12
step 11900, training accuracy 0.14
step 12000, training accuracy 0.04
step 12100, training accuracy 0.06
step 12200, training accuracy 0.1
step 12300, training accuracy 0.1
step 12400, training accuracy 0.02
step 12500, training accuracy 0.06
step 12600, training accuracy 0.12
step 12700, training accuracy 0.12
step 12800, training accuracy 0.14
step 12900, training accuracy 0.12
step 13000, training accuracy 0.12
step 13100, training accuracy 0.08
step 13200, training accuracy 0.06
step 13300, training accuracy 0.12
step 13400, training accuracy 0.14
step 13500, training accuracy 0.14
step 13600, training accuracy 0.02
step 13700, training accuracy 0.08
step 13800, training accuracy 0.1
step 13900, training accuracy 0.1
step 14000, training accuracy 0.12
step 14100, training accuracy 0.1
step 14200, training accuracy 0.14
step 14300, training accuracy 0.06
step 14400, training accuracy 0.16
step 14500, training accuracy 0.08
step 14600, training accuracy 0.12
step 14700, training accuracy 0.12
step 14800, training accuracy 0.1
step 14900, training accuracy 0.04
step 15000, training accuracy 0.18
step 15100, training accuracy 0.1
step 15200, training accuracy 0.12
step 15300, training accuracy 0.08
step 15400, training accuracy 0.12
step 15500, training accuracy 0.04
step 15600, training accuracy 0.06
step 15700, training accuracy 0.06
step 15800, training accuracy 0.14
step 15900, training accuracy 0.04
step 16000, training accuracy 0.12
step 16100, training accuracy 0.14
step 16200, training accuracy 0.12
step 16300, training accuracy 0.08
step 16400, training accuracy 0.14
step 16500, training accuracy 0.16
step 16600, training accuracy 0.14
step 16700, training accuracy 0.14
step 16800, training accuracy 0.2
step 16900, training accuracy 0.14
step 17000, training accuracy 0.18
step 17100, training accuracy 0.08
step 17200, training accuracy 0.18
step 17300, training accuracy 0.14
step 17400, training accuracy 0.16
step 17500, training accuracy 0.1
step 17600, training accuracy 0.16
step 17700, training accuracy 0.18
step 17800, training accuracy 0.14
step 17900, training accuracy 0.24
step 18000, training accuracy 0.14
step 18100, training accuracy 0.12
step 18200, training accuracy 0.1
step 18300, training accuracy 0.06
step 18400, training accuracy 0.16
step 18500, training accuracy 0.18
step 18600, training accuracy 0.1
step 18700, training accuracy 0.2
step 18800, training accuracy 0.2
step 18900, training accuracy 0.16
step 19000, training accuracy 0.24
step 19100, training accuracy 0.18
step 19200, training accuracy 0.18
step 19300, training accuracy 0.08
step 19400, training accuracy 0.2
step 19500, training accuracy 0.22
step 19600, training accuracy 0.06
step 19700, training accuracy 0.18
step 19800, training accuracy 0.12
step 19900, training accuracy 0.14
2018-06-08 21:34:47.008690: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.59GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-08 21:34:47.008746: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.32GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
2018-06-08 21:34:47.792218: W tensorflow/core/common_runtime/bfc_allocator.cc:219] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.42GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
0.1721
Saved /home/tonyng/PycharmProjects/mnist_testdemo/mnist/data/convolutional.ckpt
在model.py文件里面,权重的初始化改一下
def weight_variable(shape): initial = tf.constant(0.1, shape=shape)
改成
def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1)
就可以
和老师代码一样,准确率挺高的
请问问题解决了吗
我也是一样的情况
一开始很疑惑,不过几分钟看了一下代码就弄懂了
convolutional.py 文件里,老师修改bug的时候竟然加了一个bug
cross_entropy = -tf.reduce_sum(y_ * tf.log(y))
有负号的啊
我也是服了,本来没有bug的一句话竟然给加上了bug
老师不觉得脸红吗。。。
刚才有查看了一遍,发现问题是方法写错了,在第15行左右,
train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
我把AdamOptimizer写成了AdadeltaOptimizer导致成功率很低,不知道你是否也是这样的问题
同问,我的成功率也是很低,最高的才16%
TensorFlow与Flask结合打造手写体数字识别
20432 学习 · 102 问题
相似问题