Tensorflow CNN模型不训练吗?持续的损失和准确性 [英] Tensorflow CNN model not training? Constant loss and accuracy

查看:95
本文介绍了Tensorflow CNN模型不训练吗?持续的损失和准确性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用建立了一个模型一个基地.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆