caicloud / tensorflow-tutorial

Example TensorFlow codes and Caicloud TensorFlow as a Service dev environment.
2.93k stars 2.08k forks source link

第六章6.4.1经典卷积网络模型实际训练出来的结果比前面章节的全连接网络差很多。 #53

Closed onechenxing closed 6 years ago

onechenxing commented 7 years ago

用6.4.1的经典卷积网络模型LeNet-5训练到几万次错误率也只有0.几。 而前面的全连接模型早就0.0几了。是不是模型有些问题。 而书上说:"上面给出的卷积神经网络可以达到99.4%的正确率,相比第五章中最高的98.4%...”,挺困惑。

perhapszzy commented 7 years ago

通过这个repo里给的样例代码应该得到的运行结果是一致的

ScorpioCPH commented 7 years ago

@onechenxing 请问你是直接用的示例代码跑的吗?有改变参数吗?

onechenxing commented 7 years ago

我直接复制的示例代码(1.0.0版本)跑的,卷积网络前面5000次结果和书上的截图一样错误率只到0.6几,收敛很慢,之后到20000次一直在0.6徘徊,到60000次才到0.58徘徊,到80000次还在0.57徘徊。训练时间太久了就没继续了。与之对比,全连接网络5000次已经可以收敛到0.1了,20000次就到0.03了。

saselovejulie commented 7 years ago

我也碰到了相同的问题, 第五章全连接的神经网络在MNIST上正确率为98.3%, 第六章改造后的卷积神经网络损失函数收敛的非常慢, 我尝试修改convX_biases的值从0.0提升到0.1, 但是没效果.

saselovejulie commented 7 years ago

@perhapszzy 能贴一下你的代码吗? 我想和我的对比下. 谢谢了, 因为书上只写了mnist_inference.py的代码. 我怕其他地方的改错了.

dick318 commented 7 years ago

损失值确实是比较大,这点不解。但是如果跑测试数据你会发现,正确率是会比全连接的高一点

perhapszzy commented 7 years ago

我当时跑的代码是和书上一样的,不同版本的代码应该和这个repo中的代码一致的。

caicloud-bot commented 6 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

/lifecycle stale

caicloud-bot commented 6 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

caicloud-bot commented 6 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close