原文地址:http://siligence.ai/article-464-1.html
图片识别重要性就不多说了,现在目前tensorfow直接实现MNIST数据集是没有任何问题的,可是CIFAR-10目前官网上的办法貌似是不tensorflow1.0的,所以需要修改几个函数
重复的不写了,详情请看tensorflow官网1.0具体改动
然后就可以跑出结果啦
每次修复完所有的BUG,跑出程序的那一刻都是神清气爽。。。。
#为错误部分,下面为修改内容
#concated = tf.concat(1,[indices, sparse_labels])
concated = tf.concat([indices, sparse_labels], 1)
(tf.concate进行张量的拼接)
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(
logits, dense_labels, name=‘cross_entropy_per_example’)
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(
logits=logits, labels=dense_labels, name=‘cross_entropy_per_example’)
(tf.nn.softmax_cross_entropy_with_logits得到真实标签和预测结果的差值用于优化)
tf.scalar_summary(l.op.name +’ (raw)’, l)
tf.summary.scalar(l.op.name +' (raw)', l)
(加入tf.summary.scalar可以使用tensorboard进行可视化)
tf.summary.scalar(l.op.name, loss_averages.average(l))
# tf.scalar_summary(l.op.name, loss_averages.average(l))
tf.histogram_summary(var.op.name, var)
tf.summary.histogram(var.op.name, var)
float_image = tf.image.per_image_whitening(resized_image)
float_image = tf.image.per_image_standardization(resized_image)
在大家以后写编程的时候,可能也会遇到许许多多的坑,从装tensorflow-gpu开始就会有许多滴问题,推荐大家可以使用baidu,csdn,stackflowover这三个网站进行寻问,特别是最后一个网站,基本上大家遇到90%的问题都可以在这个网页上查到,一个小白程序员加上网络答疑可以变成一个中等水平的程序员,剩下的晋升之路可能需要写代码读论文看算法了。
祝大家都可以早日成为大佬。
(作者:cyl250 http://siligence.ai/column/index.php?page=1)
博客主要围绕TensorFlow展开,提到目前用其直接实现MNIST数据集没问题,但实现CIFAR - 10数据集时官网方法不适用于TensorFlow 1.0,需修改部分函数。文中给出了如tf.concat、tf.nn.softmax_cross_entropy_with_logits等函数的修改内容,还提及可借助tensorboard进行可视化。
723

被折叠的 条评论
为什么被折叠?



