小编Ric*_*les的帖子

TensorFlow:训练时参数不会更新

我正在使用TensorFlow实现分类模型

我面临的问题是,当我运行训练步骤时,我的体重和错误没有得到更新。结果,我的网络不断返回相同的结果。

我已经基于TensorFlow网站上的MNIST示例开发了我的模型。

import numpy as np
import tensorflow as tf
sess = tf.InteractiveSession()

#load dataset
dataset = np.loadtxt('char8k.txt', dtype='float', comments='#', delimiter=",")
Y = np.asmatrix( dataset[:,0] ) 
X = np.asmatrix( dataset[:,1:1201] )

m = 11527
labels = 26

# y is update to 11527x26
Yt = np.zeros((m,labels))

for i in range(0,m):
    index = Y[0,i] - 1
    Yt[i,index]= 1

Y = Yt
Y = np.asmatrix(Y)

#------------------------------------------------------------------------------

#graph settings

x = tf.placeholder(tf.float32, shape=[None, 1200])
y_ = tf.placeholder(tf.float32, shape=[None, 26])


Wtest …
Run Code Online (Sandbox Code Playgroud)

python ocr tensorflow

2
推荐指数
1
解决办法
4402
查看次数

标签 统计

ocr ×1

python ×1

tensorflow ×1