Tensorflow CNN模型不训练吗?持续的损失和准确性 [英] Tensorflow CNN model not training? Constant loss and accuracy
问题描述
我使用此建立了一个模型一个基地.
I have built a model using this as a base.
This model does not train and always gives the cost/loss output for every iteration.
我认为它学不到任何东西.
I dont think it learns anything.
我已经检查了诸如混洗输入之类的常见内容. 确保每个批次都是新的.
I have checked for the usual stuff like shuffled inputs. Making sure that each batch is new.
知道为什么吗?
这是我的代码.
Iter 1280, Minibatch Loss= 4.615120, Training Accuracy= 0.03125
Testing Accuracy: 0.0
Iter 2560, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.0
Iter 3840, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.015625
Iter 5120, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.078125
Iter 6400, Minibatch Loss= 4.615120, Training Accuracy= 0.03125
Testing Accuracy: 0.0
Iter 7680, Minibatch Loss= 4.615120, Training Accuracy= 0.03125
Testing Accuracy: 0.015625
Iter 8960, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.0
Iter 10240, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.015625
Iter 11520, Minibatch Loss= 4.615120, Training Accuracy= 0.00000
Testing Accuracy: 0.0
Iter 12800, Minibatch Loss= 4.615120, Training Accuracy= 0.01562
Testing Accuracy: 0.03125
Iter 14080, Minibatch Loss= 4.615120, Training Accuracy= 0.01562
Testing Accuracy: 0.0
Iter 15360, Minibatch Loss= 4.615120, Training Accuracy= 0.01562
Testing Accuracy: 0.0
推荐答案
您从中开始的代码只是向前和向后传递的基准,并不旨在进行培训.您应该从实际训练模型的示例开始,而忽略基准代码.
The code you started from is just a benchmark of the forward and backward pass and isn't designed to do training. You should start from an example that actually trains a model instead and ignore the benchmark code.
从一个完全可以运行的培训示例程序开始,您可能会更轻松,而不是尝试将两个部分组合在一起.
You might have an easier time starting from a completely working training example program instead of trying to combine two pieces.
这篇关于Tensorflow CNN模型不训练吗?持续的损失和准确性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!